41#ifdef PB_DS_CLASS_C_DEC
48 PB_DS_ASSERT_VALID((*
this))
55 reallocate_metadata((node_update* )
this, 0);
56 cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
59 _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
62 m_end_it = m_a_values;
63 PB_DS_ASSERT_VALID((*
this))
67template<
typename Pred>
68inline typename PB_DS_CLASS_C_DEC::size_type
72 PB_DS_ASSERT_VALID((*
this))
74#ifdef PB_DS_REGRESSION
75 typename _Alloc::group_adjustor adjust(m_size);
78 size_type new_size = 0;
79 size_type num_val_ersd = 0;
81 for (iterator source_it = begin(); source_it != m_end_it; ++source_it)
82 if (!pred(*source_it))
93 value_vector a_new_values = s_value_alloc.allocate(new_size);
94 iterator target_it = a_new_values;
95 cond_dtor<size_type> cd(a_new_values, target_it, new_size);
97 struct dbase : debug_base {
98 using debug_base::swap;
99 using debug_base::insert_new;
101 for (iterator source_it = begin(); source_it != m_end_it; ++source_it)
103 if (!pred(*source_it))
105 new (
const_cast<void*
>(
static_cast<const void*
>(target_it)))
106 value_type(*source_it);
108 _GLIBCXX_DEBUG_ONLY(d.insert_new(PB_DS_V2F(*source_it)));
113 reallocate_metadata((node_update*)
this, new_size);
114 _GLIBCXX_DEBUG_ONLY(d.swap(*
this));
118 cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
121 m_a_values = a_new_values;
123 m_end_it = target_it;
124 update(node_begin(), (node_update*)
this);
125 PB_DS_ASSERT_VALID((*
this))
135 PB_DS_ASSERT_VALID((*
this))
139 PB_DS_CHECK_KEY_EXISTS(PB_DS_V2F(*it))
141#ifdef PB_DS_REGRESSION
142 typename _Alloc::group_adjustor adjust(m_size);
145 _GLIBCXX_DEBUG_ASSERT(m_size > 0);
146 value_vector a_values = 0;
148 a_values = s_value_alloc.allocate(m_size - 1);
149 iterator source_it = begin();
150 iterator source_end_it = end();
151 iterator target_it = a_values;
152 iterator ret_it = end();
154 cond_dtor<size_type> cd(a_values, target_it, m_size - 1);
156 _GLIBCXX_DEBUG_ONLY(size_type cnt = 0;)
158 while (source_it != source_end_it)
162 _GLIBCXX_DEBUG_ONLY(++cnt;)
163 _GLIBCXX_DEBUG_ASSERT(cnt != m_size);
164 new (
const_cast<void*
>(
static_cast<const void*
>(target_it)))
165 value_type(*source_it);
174 _GLIBCXX_DEBUG_ASSERT(m_size > 0);
175 reallocate_metadata((node_update*)
this, m_size - 1);
177 _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(*it));)
179 cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
182 m_a_values = a_values;
184 m_end_it = m_a_values + m_size;
185 update(node_begin(), (node_update*)
this);
186 PB_DS_ASSERT_VALID((*
this))
193erase(key_const_reference r_key)
195 point_iterator it = find(r_key);