41#ifdef PB_DS_CLASS_C_DEC
44typename PB_DS_CLASS_C_DEC::head_allocator
45PB_DS_CLASS_C_DEC::s_head_allocator;
48typename PB_DS_CLASS_C_DEC::inode_allocator
49PB_DS_CLASS_C_DEC::s_inode_allocator;
52typename PB_DS_CLASS_C_DEC::leaf_allocator
53PB_DS_CLASS_C_DEC::s_leaf_allocator;
57PB_DS_PAT_TRIE_NAME() :
58 m_p_head(s_head_allocator.allocate(1)),
62 PB_DS_ASSERT_VALID((*
this))
67PB_DS_PAT_TRIE_NAME(
const access_traits& r_access_traits) :
68 synth_access_traits(r_access_traits),
69 m_p_head(s_head_allocator.allocate(1)),
73 PB_DS_ASSERT_VALID((*
this))
78PB_DS_PAT_TRIE_NAME(
const PB_DS_CLASS_C_DEC& other) :
82 synth_access_traits(other),
84 m_p_head(s_head_allocator.allocate(1)),
88 m_size = other.m_size;
89 PB_DS_ASSERT_VALID(other)
90 if (other.m_p_head->m_p_parent == 0)
92 PB_DS_ASSERT_VALID((*
this))
97 m_p_head->m_p_parent = recursive_copy_node(other.m_p_head->m_p_parent);
101 s_head_allocator.deallocate(m_p_head, 1);
102 __throw_exception_again;
105 m_p_head->m_p_min = leftmost_descendant(m_p_head->m_p_parent);
106 m_p_head->m_p_max = rightmost_descendant(m_p_head->m_p_parent);
107 m_p_head->m_p_parent->m_p_parent = m_p_head;
108 PB_DS_ASSERT_VALID((*
this))
114swap(PB_DS_CLASS_C_DEC& other)
116 PB_DS_ASSERT_VALID((*
this))
117 PB_DS_ASSERT_VALID(other)
119 std::swap((access_traits& )(*this), (access_traits& )other);
120 PB_DS_ASSERT_VALID((*this))
121 PB_DS_ASSERT_VALID(other)
127value_swap(PB_DS_CLASS_C_DEC& other)
129 _GLIBCXX_DEBUG_ONLY(debug_base::swap(other);)
136~PB_DS_PAT_TRIE_NAME()
139 s_head_allocator.deallocate(m_p_head, 1);
147 new (m_p_head) head();
148 m_p_head->m_p_parent = 0;
149 m_p_head->m_p_min = m_p_head;
150 m_p_head->m_p_max = m_p_head;
158copy_from_range(It first_it, It last_it)
160 while (first_it != last_it)
161 insert(*(first_it++));
165typename PB_DS_CLASS_C_DEC::node_pointer
167recursive_copy_node(node_const_pointer p_ncp)
169 _GLIBCXX_DEBUG_ASSERT(p_ncp != 0);
170 if (p_ncp->m_type == leaf_node)
172 leaf_const_pointer p_other_lf =
static_cast<leaf_const_pointer
>(p_ncp);
173 leaf_pointer p_new_lf = s_leaf_allocator.allocate(1);
174 cond_dealtor cond(p_new_lf);
175 new (p_new_lf) leaf(p_other_lf->value());
176 apply_update(p_new_lf, (node_update*)
this);
177 cond.set_no_action_dtor();
181 _GLIBCXX_DEBUG_ASSERT(p_ncp->m_type == i_node);
182 node_pointer a_p_children[inode::arr_size];
183 size_type child_i = 0;
184 inode_const_pointer p_icp =
static_cast<inode_const_pointer
>(p_ncp);
186 typename inode::const_iterator child_it = p_icp->begin();
191 while (child_it != p_icp->end())
193 a_p_children[child_i] = recursive_copy_node(*(child_it));
197 p_ret = s_inode_allocator.allocate(1);
201 while (child_i-- > 0)
202 clear_imp(a_p_children[child_i]);
203 __throw_exception_again;
206 new (p_ret) inode(p_icp->get_e_ind(), pref_begin(a_p_children[0]));
209 _GLIBCXX_DEBUG_ASSERT(child_i >= 1);
211 p_ret->add_child(a_p_children[child_i], pref_begin(a_p_children[child_i]),
212 pref_end(a_p_children[child_i]),
this);
213 while (child_i-- > 0);
214 apply_update(p_ret, (node_update*)
this);
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
ISO C++ entities toplevel namespace is std.