163d1a8abSmrg // -*- C++ -*-
263d1a8abSmrg 
3*ec02198aSmrg // Copyright (C) 2005-2020 Free Software Foundation, Inc.
463d1a8abSmrg //
563d1a8abSmrg // This file is part of the GNU ISO C++ Library.  This library is free
663d1a8abSmrg // software; you can redistribute it and/or modify it under the terms
763d1a8abSmrg // of the GNU General Public License as published by the Free Software
863d1a8abSmrg // Foundation; either version 3, or (at your option) any later
963d1a8abSmrg // version.
1063d1a8abSmrg 
1163d1a8abSmrg // This library is distributed in the hope that it will be useful, but
1263d1a8abSmrg // WITHOUT ANY WARRANTY; without even the implied warranty of
1363d1a8abSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1463d1a8abSmrg // General Public License for more details.
1563d1a8abSmrg 
1663d1a8abSmrg // Under Section 7 of GPL version 3, you are granted additional
1763d1a8abSmrg // permissions described in the GCC Runtime Library Exception, version
1863d1a8abSmrg // 3.1, as published by the Free Software Foundation.
1963d1a8abSmrg 
2063d1a8abSmrg // You should have received a copy of the GNU General Public License and
2163d1a8abSmrg // a copy of the GCC Runtime Library Exception along with this program;
2263d1a8abSmrg // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2363d1a8abSmrg // <http://www.gnu.org/licenses/>.
2463d1a8abSmrg 
2563d1a8abSmrg // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
2663d1a8abSmrg 
2763d1a8abSmrg // Permission to use, copy, modify, sell, and distribute this software
2863d1a8abSmrg // is hereby granted without fee, provided that the above copyright
2963d1a8abSmrg // notice appears in all copies, and that both that copyright notice
3063d1a8abSmrg // and this permission notice appear in supporting documentation. None
3163d1a8abSmrg // of the above authors, nor IBM Haifa Research Laboratories, make any
3263d1a8abSmrg // representation about the suitability of this software for any
3363d1a8abSmrg // purpose. It is provided "as is" without express or implied
3463d1a8abSmrg // warranty.
3563d1a8abSmrg 
3663d1a8abSmrg /**
3763d1a8abSmrg  * @file rb_tree_map_/constructors_destructor_fn_imps.hpp
3863d1a8abSmrg  * Contains an implementation for rb_tree_.
3963d1a8abSmrg  */
4063d1a8abSmrg 
41*ec02198aSmrg #ifdef PB_DS_CLASS_C_DEC
42*ec02198aSmrg 
4363d1a8abSmrg PB_DS_CLASS_T_DEC
4463d1a8abSmrg template<typename It>
4563d1a8abSmrg void
4663d1a8abSmrg PB_DS_CLASS_C_DEC::
copy_from_range(It first_it,It last_it)4763d1a8abSmrg copy_from_range(It first_it, It last_it)
4863d1a8abSmrg {
4963d1a8abSmrg   while (first_it != last_it)
5063d1a8abSmrg     insert(*(first_it++));
5163d1a8abSmrg }
5263d1a8abSmrg 
5363d1a8abSmrg PB_DS_CLASS_T_DEC
5463d1a8abSmrg PB_DS_CLASS_C_DEC::
PB_DS_RB_TREE_NAME()5563d1a8abSmrg PB_DS_RB_TREE_NAME()
5663d1a8abSmrg {
5763d1a8abSmrg   initialize();
5863d1a8abSmrg   PB_DS_ASSERT_VALID((*this))
5963d1a8abSmrg }
6063d1a8abSmrg 
6163d1a8abSmrg PB_DS_CLASS_T_DEC
6263d1a8abSmrg PB_DS_CLASS_C_DEC::
PB_DS_RB_TREE_NAME(const Cmp_Fn & r_cmp_fn)6363d1a8abSmrg PB_DS_RB_TREE_NAME(const Cmp_Fn& r_cmp_fn) :
6463d1a8abSmrg   base_type(r_cmp_fn)
6563d1a8abSmrg {
6663d1a8abSmrg   initialize();
6763d1a8abSmrg   PB_DS_ASSERT_VALID((*this))
6863d1a8abSmrg }
6963d1a8abSmrg 
7063d1a8abSmrg PB_DS_CLASS_T_DEC
7163d1a8abSmrg PB_DS_CLASS_C_DEC::
PB_DS_RB_TREE_NAME(const Cmp_Fn & r_cmp_fn,const node_update & r_node_update)7263d1a8abSmrg PB_DS_RB_TREE_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) :
7363d1a8abSmrg   base_type(r_cmp_fn, r_node_update)
7463d1a8abSmrg {
7563d1a8abSmrg   initialize();
7663d1a8abSmrg   PB_DS_ASSERT_VALID((*this))
7763d1a8abSmrg }
7863d1a8abSmrg 
7963d1a8abSmrg PB_DS_CLASS_T_DEC
8063d1a8abSmrg PB_DS_CLASS_C_DEC::
PB_DS_RB_TREE_NAME(const PB_DS_CLASS_C_DEC & other)8163d1a8abSmrg PB_DS_RB_TREE_NAME(const PB_DS_CLASS_C_DEC& other) :
8263d1a8abSmrg   base_type(other)
8363d1a8abSmrg {
8463d1a8abSmrg   initialize();
8563d1a8abSmrg   PB_DS_ASSERT_VALID((*this))
8663d1a8abSmrg }
8763d1a8abSmrg 
8863d1a8abSmrg PB_DS_CLASS_T_DEC
8963d1a8abSmrg void
9063d1a8abSmrg PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC & other)9163d1a8abSmrg swap(PB_DS_CLASS_C_DEC& other)
9263d1a8abSmrg {
9363d1a8abSmrg   PB_DS_ASSERT_VALID((*this))
9463d1a8abSmrg   base_type::swap(other);
9563d1a8abSmrg   PB_DS_ASSERT_VALID((*this))
9663d1a8abSmrg }
9763d1a8abSmrg 
9863d1a8abSmrg PB_DS_CLASS_T_DEC
9963d1a8abSmrg void
10063d1a8abSmrg PB_DS_CLASS_C_DEC::
initialize()10163d1a8abSmrg initialize()
10263d1a8abSmrg { base_type::m_p_head->m_red = true; }
103*ec02198aSmrg #endif
104