41 #ifdef PB_DS_CLASS_C_DEC
44 typename PB_DS_CLASS_C_DEC::value_allocator
45 PB_DS_CLASS_C_DEC::s_value_alloc;
48 typename PB_DS_CLASS_C_DEC::metadata_allocator
49 PB_DS_CLASS_C_DEC::s_metadata_alloc;
53 PB_DS_OV_TREE_NAME() :
58 { PB_DS_ASSERT_VALID((*
this)) }
62 PB_DS_OV_TREE_NAME(
const Cmp_Fn& r_cmp_fn) :
68 { PB_DS_ASSERT_VALID((*
this)) }
72 PB_DS_OV_TREE_NAME(
const Cmp_Fn& r_cmp_fn,
const node_update& r_nodeu) :
79 { PB_DS_ASSERT_VALID((*
this)) }
83 PB_DS_OV_TREE_NAME(
const PB_DS_CLASS_C_DEC& other) :
84 #ifdef PB_DS_TREE_TRACE
94 copy_from_ordered_range(other.begin(), other.end());
95 PB_DS_ASSERT_VALID((*
this))
102 copy_from_range(It first_it, It last_it)
104 #ifdef PB_DS_DATA_TRUE_INDICATOR
105 typedef std::map<key_type, mapped_type, Cmp_Fn,
106 typename rebind_traits<_Alloc, value_type>::allocator_type>
110 typename rebind_traits<_Alloc, Key>::allocator_type>
114 map_type m(first_it, last_it);
115 copy_from_ordered_range(m.begin(), m.end());
116 PB_DS_ASSERT_VALID((*
this))
120 template<
typename It>
123 copy_from_ordered_range(It first_it, It last_it)
129 value_vector a_values = s_value_alloc.allocate(len);
130 iterator target_it = a_values;
131 It source_it = first_it;
132 It source_end_it = last_it;
134 cond_dtor<size_type> cd(a_values, target_it, len);
135 while (source_it != source_end_it)
137 void* __v =
const_cast<void*
>(
static_cast<const void*
>(target_it));
138 new (__v) value_type(*source_it++);
142 reallocate_metadata((node_update*)
this, len);
144 m_a_values = a_values;
146 m_end_it = m_a_values + m_size;
147 update(PB_DS_node_begin_imp(), (node_update*)
this);
149 #ifdef _GLIBCXX_DEBUG
150 for (const_iterator dbg_it = m_a_values; dbg_it != m_end_it; ++dbg_it)
151 debug_base::insert_new(PB_DS_V2F(*dbg_it));
156 template<
typename It>
159 copy_from_ordered_range(It first_it, It last_it, It other_first_it,
166 value_vector a_values = s_value_alloc.allocate(len);
168 iterator target_it = a_values;
169 It source_it = first_it;
170 It source_end_it = last_it;
172 cond_dtor<size_type> cd(a_values, target_it, len);
173 while (source_it != source_end_it)
175 new (
const_cast<void*
>(
static_cast<const void*
>(target_it)))
176 value_type(*source_it++);
180 source_it = other_first_it;
181 source_end_it = other_last_it;
183 while (source_it != source_end_it)
185 new (
const_cast<void*
>(
static_cast<const void*
>(target_it)))
186 value_type(*source_it++);
190 reallocate_metadata((node_update* )
this, len);
192 m_a_values = a_values;
194 m_end_it = m_a_values + m_size;
195 update(PB_DS_node_begin_imp(), (node_update* )
this);
197 #ifdef _GLIBCXX_DEBUG
198 for (const_iterator dbg_it = m_a_values; dbg_it != m_end_it; ++dbg_it)
199 debug_base::insert_new(PB_DS_V2F(*dbg_it));
206 swap(PB_DS_CLASS_C_DEC& other)
208 PB_DS_ASSERT_VALID((*
this))
209 PB_DS_ASSERT_VALID(other)
211 std::
swap(static_cast<cmp_fn&>(*this),
212 static_cast<cmp_fn&>(other));
213 std::
swap(static_cast<traits_base&>(*this),
214 static_cast<traits_base&>(other));
215 PB_DS_ASSERT_VALID(other)
216 PB_DS_ASSERT_VALID((*this))
222 value_swap(PB_DS_CLASS_C_DEC& other)
224 _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
225 std::swap(m_a_values, other.m_a_values);
226 std::swap(m_a_metadata, other.m_a_metadata);
227 std::swap(m_size, other.m_size);
228 std::swap(m_end_it, other.m_end_it);
233 ~PB_DS_OV_TREE_NAME()
235 PB_DS_ASSERT_VALID((*
this))
236 cond_dtor<size_type> cd(m_a_values, m_end_it, m_size);
237 reallocate_metadata((node_update*)this, 0);
243 update(node_iterator, null_node_update_pointer)
247 template<
typename Node_Update>
250 update(node_iterator nd_it, Node_Update* p_update)
252 node_const_iterator end_it = PB_DS_node_end_imp();
255 update(nd_it.get_l_child(), p_update);
256 update(nd_it.get_r_child(), p_update);
257 node_update::operator()(nd_it, end_it);
void swap(basic_regex< _Ch_type, _Rx_traits > &__lhs, basic_regex< _Ch_type, _Rx_traits > &__rhs)
Swaps the contents of two regular expression objects.
ISO C++ entities toplevel namespace is std.
constexpr iterator_traits< _InputIterator >::difference_type distance(_InputIterator __first, _InputIterator __last)
A generalization of pointer arithmetic.
A standard container made up of (key,value) pairs, which can be retrieved based on a key,...
A standard container made up of unique keys, which can be retrieved in logarithmic time.