1*63d1a8abSmrg // -*- C++ -*- 2*63d1a8abSmrg 3*63d1a8abSmrg // Copyright (C) 2005-2017 Free Software Foundation, Inc. 4*63d1a8abSmrg // 5*63d1a8abSmrg // This file is part of the GNU ISO C++ Library. This library is free 6*63d1a8abSmrg // software; you can redistribute it and/or modify it under the terms 7*63d1a8abSmrg // of the GNU General Public License as published by the Free Software 8*63d1a8abSmrg // Foundation; either version 3, or (at your option) any later 9*63d1a8abSmrg // version. 10*63d1a8abSmrg 11*63d1a8abSmrg // This library is distributed in the hope that it will be useful, but 12*63d1a8abSmrg // WITHOUT ANY WARRANTY; without even the implied warranty of 13*63d1a8abSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14*63d1a8abSmrg // General Public License for more details. 15*63d1a8abSmrg 16*63d1a8abSmrg // Under Section 7 of GPL version 3, you are granted additional 17*63d1a8abSmrg // permissions described in the GCC Runtime Library Exception, version 18*63d1a8abSmrg // 3.1, as published by the Free Software Foundation. 19*63d1a8abSmrg 20*63d1a8abSmrg // You should have received a copy of the GNU General Public License and 21*63d1a8abSmrg // a copy of the GCC Runtime Library Exception along with this program; 22*63d1a8abSmrg // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 23*63d1a8abSmrg // <http://www.gnu.org/licenses/>. 24*63d1a8abSmrg 25*63d1a8abSmrg // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL. 26*63d1a8abSmrg 27*63d1a8abSmrg // Permission to use, copy, modify, sell, and distribute this software 28*63d1a8abSmrg // is hereby granted without fee, provided that the above copyright 29*63d1a8abSmrg // notice appears in all copies, and that both that copyright notice 30*63d1a8abSmrg // and this permission notice appear in supporting documentation. None 31*63d1a8abSmrg // of the above authors, nor IBM Haifa Research Laboratories, make any 32*63d1a8abSmrg // representation about the suitability of this software for any 33*63d1a8abSmrg // purpose. It is provided "as is" without express or implied 34*63d1a8abSmrg // warranty. 35*63d1a8abSmrg 36*63d1a8abSmrg /** 37*63d1a8abSmrg * @file rb_tree_map_/constructors_destructor_fn_imps.hpp 38*63d1a8abSmrg * Contains an implementation for rb_tree_. 39*63d1a8abSmrg */ 40*63d1a8abSmrg 41*63d1a8abSmrg PB_DS_CLASS_T_DEC 42*63d1a8abSmrg template<typename It> 43*63d1a8abSmrg void 44*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 45*63d1a8abSmrg copy_from_range(It first_it, It last_it) 46*63d1a8abSmrg { 47*63d1a8abSmrg while (first_it != last_it) 48*63d1a8abSmrg insert(*(first_it++)); 49*63d1a8abSmrg } 50*63d1a8abSmrg 51*63d1a8abSmrg PB_DS_CLASS_T_DEC 52*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 53*63d1a8abSmrg PB_DS_RB_TREE_NAME() 54*63d1a8abSmrg { 55*63d1a8abSmrg initialize(); 56*63d1a8abSmrg PB_DS_ASSERT_VALID((*this)) 57*63d1a8abSmrg } 58*63d1a8abSmrg 59*63d1a8abSmrg PB_DS_CLASS_T_DEC 60*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 61*63d1a8abSmrg PB_DS_RB_TREE_NAME(const Cmp_Fn& r_cmp_fn) : 62*63d1a8abSmrg base_type(r_cmp_fn) 63*63d1a8abSmrg { 64*63d1a8abSmrg initialize(); 65*63d1a8abSmrg PB_DS_ASSERT_VALID((*this)) 66*63d1a8abSmrg } 67*63d1a8abSmrg 68*63d1a8abSmrg PB_DS_CLASS_T_DEC 69*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 70*63d1a8abSmrg PB_DS_RB_TREE_NAME(const Cmp_Fn& r_cmp_fn, const node_update& r_node_update) : 71*63d1a8abSmrg base_type(r_cmp_fn, r_node_update) 72*63d1a8abSmrg { 73*63d1a8abSmrg initialize(); 74*63d1a8abSmrg PB_DS_ASSERT_VALID((*this)) 75*63d1a8abSmrg } 76*63d1a8abSmrg 77*63d1a8abSmrg PB_DS_CLASS_T_DEC 78*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 79*63d1a8abSmrg PB_DS_RB_TREE_NAME(const PB_DS_CLASS_C_DEC& other) : 80*63d1a8abSmrg base_type(other) 81*63d1a8abSmrg { 82*63d1a8abSmrg initialize(); 83*63d1a8abSmrg PB_DS_ASSERT_VALID((*this)) 84*63d1a8abSmrg } 85*63d1a8abSmrg 86*63d1a8abSmrg PB_DS_CLASS_T_DEC 87*63d1a8abSmrg void 88*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 89*63d1a8abSmrg swap(PB_DS_CLASS_C_DEC& other) 90*63d1a8abSmrg { 91*63d1a8abSmrg PB_DS_ASSERT_VALID((*this)) 92*63d1a8abSmrg base_type::swap(other); 93*63d1a8abSmrg PB_DS_ASSERT_VALID((*this)) 94*63d1a8abSmrg } 95*63d1a8abSmrg 96*63d1a8abSmrg PB_DS_CLASS_T_DEC 97*63d1a8abSmrg void 98*63d1a8abSmrg PB_DS_CLASS_C_DEC:: 99*63d1a8abSmrg initialize() 100*63d1a8abSmrg { base_type::m_p_head->m_red = true; } 101