42 #ifdef PB_DS_CLASS_C_DEC
45 typename PB_DS_CLASS_C_DEC::entry_allocator
46 PB_DS_CLASS_C_DEC::s_entry_allocator;
52 copy_from_range(It first_it, It last_it)
54 while (first_it != last_it)
55 insert(*(first_it++));
61 : ranged_probe_fn_base(resize_base::get_nearest_larger_size(1)),
62 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
63 m_entries(s_entry_allocator.allocate(m_num_e))
66 PB_DS_ASSERT_VALID((*
this))
71 PB_DS_GP_HASH_NAME(
const Hash_Fn& r_hash_fn)
72 : ranged_probe_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
73 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
74 m_entries(s_entry_allocator.allocate(m_num_e))
77 PB_DS_ASSERT_VALID((*
this))
82 PB_DS_GP_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn)
83 : hash_eq_fn_base(r_eq_fn),
84 ranged_probe_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
85 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
86 m_entries(s_entry_allocator.allocate(m_num_e))
89 PB_DS_ASSERT_VALID((*
this))
94 PB_DS_GP_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn,
95 const Comb_Probe_Fn& r_comb_hash_fn)
96 : hash_eq_fn_base(r_eq_fn),
97 ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
98 r_hash_fn, r_comb_hash_fn),
99 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
100 m_entries(s_entry_allocator.allocate(m_num_e))
103 PB_DS_ASSERT_VALID((*
this))
108 PB_DS_GP_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn,
109 const Comb_Probe_Fn& comb_hash_fn,
const Probe_Fn& prober)
110 : hash_eq_fn_base(r_eq_fn),
111 ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
112 r_hash_fn, comb_hash_fn, prober),
113 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
114 m_entries(s_entry_allocator.allocate(m_num_e))
117 PB_DS_ASSERT_VALID((*
this))
122 PB_DS_GP_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn,
123 const Comb_Probe_Fn& comb_hash_fn,
const Probe_Fn& prober,
124 const Resize_Policy& r_resize_policy)
125 : hash_eq_fn_base(r_eq_fn), resize_base(r_resize_policy),
126 ranged_probe_fn_base(resize_base::get_nearest_larger_size(1),
127 r_hash_fn, comb_hash_fn, prober),
128 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
129 m_entries(s_entry_allocator.allocate(m_num_e))
132 PB_DS_ASSERT_VALID((*
this))
137 PB_DS_GP_HASH_NAME(
const PB_DS_CLASS_C_DEC& other) :
138 #ifdef _GLIBCXX_DEBUG
141 hash_eq_fn_base(other),
143 ranged_probe_fn_base(other),
144 m_num_e(other.m_num_e),
145 m_num_used_e(other.m_num_used_e),
146 m_entries(s_entry_allocator.allocate(m_num_e))
148 for (size_type i = 0; i < m_num_e; ++i)
149 m_entries[i].m_stat = (entry_status)empty_entry_status;
153 for (size_type i = 0; i < m_num_e; ++i)
155 m_entries[i].m_stat = other.m_entries[i].m_stat;
156 if (m_entries[i].m_stat == valid_entry_status)
157 new (m_entries + i) entry(other.m_entries[i]);
163 __throw_exception_again;
165 PB_DS_ASSERT_VALID((*
this))
170 ~PB_DS_GP_HASH_NAME()
171 { deallocate_all(); }
176 swap(PB_DS_CLASS_C_DEC& other)
178 PB_DS_ASSERT_VALID((*
this))
179 PB_DS_ASSERT_VALID(other)
180 std::
swap(m_num_e, other.m_num_e);
181 std::
swap(m_num_used_e, other.m_num_used_e);
182 std::
swap(m_entries, other.m_entries);
183 ranged_probe_fn_base::
swap(other);
184 hash_eq_fn_base::
swap(other);
185 resize_base::
swap(other);
186 _GLIBCXX_DEBUG_ONLY(debug_base::
swap(other));
187 PB_DS_ASSERT_VALID((*this))
188 PB_DS_ASSERT_VALID(other)
197 erase_all_valid_entries(m_entries, m_num_e);
198 s_entry_allocator.deallocate(m_entries, m_num_e);
204 erase_all_valid_entries(entry_array a_entries_resized, size_type len)
206 for (size_type pos = 0; pos < len; ++pos)
208 entry_pointer p_e = &a_entries_resized[pos];
209 if (p_e->m_stat == valid_entry_status)
210 p_e->m_value.~value_type();
219 Resize_Policy::notify_resized(m_num_e);
220 Resize_Policy::notify_cleared();
221 ranged_probe_fn_base::notify_resized(m_num_e);
222 for (size_type i = 0; i < m_num_e; ++i)
223 m_entries[i].m_stat = empty_entry_status;
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.