3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the terms
8 // of the GNU General Public License as published by the Free Software
9 // Foundation; either version 3, or (at your option) any later
12 // This library is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
26 // Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
28 // Permission to use, copy, modify, sell, and distribute this software
29 // is hereby granted without fee, provided that the above copyright
30 // notice appears in all copies, and that both that copyright notice
31 // and this permission notice appear in supporting documentation. None
32 // of the above authors, nor IBM Haifa Research Laboratories, make any
33 // representation about the suitability of this software for any
34 // purpose. It is provided "as is" without express or implied
38 * @file list_update_map_/constructor_destructor_fn_imps.hpp
42 typename PB_DS_CLASS_C_DEC::entry_allocator
43 PB_DS_CLASS_C_DEC::s_entry_allocator;
46 Eq_Fn PB_DS_CLASS_C_DEC::s_eq_fn;
49 null_type PB_DS_CLASS_C_DEC::s_null_type;
52 Update_Policy PB_DS_CLASS_C_DEC::s_update_policy;
56 typename PB_DS_CLASS_C_DEC::update_metadata> PB_DS_CLASS_C_DEC::s_metadata_type_indicator;
62 copy_from_range(It first_it, It last_it)
64 while (first_it != last_it)
65 insert(*(first_it++));
70 PB_DS_LU_NAME() : m_p_l(0)
71 { PB_DS_ASSERT_VALID((*this)) }
76 PB_DS_LU_NAME(It first_it, It last_it) : m_p_l(0)
78 copy_from_range(first_it, last_it);
79 PB_DS_ASSERT_VALID((*this));
84 PB_DS_LU_NAME(const PB_DS_CLASS_C_DEC& other) :
89 for (const_iterator it = other.begin(); it != other.end(); ++it)
91 entry_pointer p_l = allocate_new_entry(*it,
92 traits_base::m_no_throw_copies_indicator);
94 p_l->m_p_next = m_p_l;
101 __throw_exception_again;
103 PB_DS_ASSERT_VALID((*this))
109 swap(PB_DS_CLASS_C_DEC& other)
111 PB_DS_ASSERT_VALID((*this))
112 PB_DS_ASSERT_VALID(other)
113 _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
114 std::swap(m_p_l, other.m_p_l);
115 PB_DS_ASSERT_VALID((*this))
116 PB_DS_ASSERT_VALID(other)
124 entry_pointer p_l = m_p_l;
127 entry_pointer p_next_l = p_l->m_p_next;
128 actual_erase_entry(p_l);
137 { deallocate_all(); }