46 PB_DS_ASSERT_VALID((*
this))
53 reallocate_metadata((node_update* )
this, 0);
54 cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
57 _GLIBCXX_DEBUG_ONLY(debug_base::clear();)
60 m_end_it = m_a_values;
61 PB_DS_ASSERT_VALID((*
this))
65 template<
typename Pred>
66 inline typename PB_DS_CLASS_C_DEC::size_type
70 PB_DS_ASSERT_VALID((*
this))
72 #ifdef PB_DS_REGRESSION
73 typename _Alloc::group_adjustor adjust(m_size);
76 size_type new_size = 0;
77 size_type num_val_ersd = 0;
79 for (iterator source_it =
begin(); source_it != m_end_it; ++source_it)
80 if (!pred(*source_it))
91 value_vector a_new_values = s_value_alloc.allocate(new_size);
92 iterator target_it = a_new_values;
93 cond_dtor<size_type> cd(a_new_values, target_it, new_size);
94 _GLIBCXX_DEBUG_ONLY(debug_base::clear());
95 for (iterator source_it =
begin(); source_it != m_end_it; ++source_it)
97 if (!pred(*source_it))
99 new (
const_cast<void*
>(
static_cast<const void*
>(target_it)))
100 value_type(*source_it);
102 _GLIBCXX_DEBUG_ONLY(debug_base::insert_new(PB_DS_V2F(*source_it)));
107 reallocate_metadata((node_update*)
this, new_size);
111 cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
114 m_a_values = a_new_values;
116 m_end_it = target_it;
117 update(node_begin(), (node_update*)
this);
118 PB_DS_ASSERT_VALID((*
this))
123 template<typename It>
128 PB_DS_ASSERT_VALID((*
this))
132 PB_DS_CHECK_KEY_EXISTS(PB_DS_V2F(*it))
134 #ifdef PB_DS_REGRESSION
135 typename _Alloc::group_adjustor adjust(m_size);
138 _GLIBCXX_DEBUG_ASSERT(m_size > 0);
139 value_vector a_values = s_value_alloc.allocate(m_size - 1);
140 iterator source_it =
begin();
141 iterator source_end_it =
end();
142 iterator target_it = a_values;
143 iterator ret_it =
end();
145 cond_dtor<size_type> cd(a_values, target_it, m_size - 1);
147 _GLIBCXX_DEBUG_ONLY(size_type cnt = 0;)
149 while (source_it != source_end_it)
153 _GLIBCXX_DEBUG_ONLY(++cnt;)
154 _GLIBCXX_DEBUG_ASSERT(cnt != m_size);
155 new (
const_cast<void*
>(
static_cast<const void*
>(target_it)))
156 value_type(*source_it);
165 _GLIBCXX_DEBUG_ASSERT(m_size > 0);
166 reallocate_metadata((node_update*)
this, m_size - 1);
168 _GLIBCXX_DEBUG_ONLY(debug_base::erase_existing(PB_DS_V2F(*it));)
170 cond_dtor<size_type> cd1(m_a_values, m_end_it, m_size);
173 m_a_values = a_values;
175 m_end_it = m_a_values + m_size;
176 update(node_begin(), (node_update*)
this);
177 PB_DS_ASSERT_VALID((*
this))
184 erase(key_const_reference r_key)
186 point_iterator it = find(r_key);
constexpr const _Tp * end(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to one past the last element of the initilizer_list.
constexpr const _Tp * begin(initializer_list< _Tp > __ils) noexcept
Return an iterator pointing to the first element of the initilizer_list.