44 typename PB_DS_CLASS_C_DEC::entry_allocator
45 PB_DS_CLASS_C_DEC::s_entry_allocator;
48 typename PB_DS_CLASS_C_DEC::entry_pointer_allocator
49 PB_DS_CLASS_C_DEC::s_entry_pointer_allocator;
55 copy_from_range(It first_it, It last_it)
57 while (first_it != last_it)
58 insert(*(first_it++));
63 PB_DS_CC_HASH_NAME() :
64 ranged_hash_fn_base(resize_base::get_nearest_larger_size(1)),
65 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
66 m_entries(s_entry_pointer_allocator.allocate(m_num_e))
69 PB_DS_ASSERT_VALID((*
this))
74 PB_DS_CC_HASH_NAME(
const Hash_Fn& r_hash_fn) :
75 ranged_hash_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
76 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
77 m_entries(s_entry_pointer_allocator.allocate(m_num_e))
80 PB_DS_ASSERT_VALID((*
this))
85 PB_DS_CC_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn) :
86 PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
87 ranged_hash_fn_base(resize_base::get_nearest_larger_size(1), r_hash_fn),
88 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
89 m_entries(s_entry_pointer_allocator.allocate(m_num_e))
91 std::fill(m_entries, m_entries + m_num_e, (entry_pointer)0);
92 Resize_Policy::notify_cleared();
93 ranged_hash_fn_base::notify_resized(m_num_e);
94 PB_DS_ASSERT_VALID((*
this))
99 PB_DS_CC_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn,
100 const Comb_Hash_Fn& r_comb_hash_fn) :
101 PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
102 ranged_hash_fn_base(resize_base::get_nearest_larger_size(1),
103 r_hash_fn, r_comb_hash_fn),
104 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
105 m_entries(s_entry_pointer_allocator.allocate(m_num_e))
108 PB_DS_ASSERT_VALID((*
this))
113 PB_DS_CC_HASH_NAME(
const Hash_Fn& r_hash_fn,
const Eq_Fn& r_eq_fn,
114 const Comb_Hash_Fn& r_comb_hash_fn,
115 const Resize_Policy& r_resize_policy) :
116 PB_DS_HASH_EQ_FN_C_DEC(r_eq_fn),
117 Resize_Policy(r_resize_policy),
118 ranged_hash_fn_base(resize_base::get_nearest_larger_size(1),
119 r_hash_fn, r_comb_hash_fn),
120 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
121 m_entries(s_entry_pointer_allocator.allocate(m_num_e))
124 PB_DS_ASSERT_VALID((*
this))
129 PB_DS_CC_HASH_NAME(
const PB_DS_CLASS_C_DEC& other) :
130 PB_DS_HASH_EQ_FN_C_DEC(other),
131 resize_base(other), ranged_hash_fn_base(other),
132 m_num_e(resize_base::get_nearest_larger_size(1)), m_num_used_e(0),
133 m_entries(s_entry_pointer_allocator.allocate(m_num_e))
136 PB_DS_ASSERT_VALID((*
this))
139 copy_from_range(other.begin(), other.end());
144 __throw_exception_again;
146 PB_DS_ASSERT_VALID((*
this))
151 ~PB_DS_CC_HASH_NAME()
152 { deallocate_all(); }
157 swap(PB_DS_CLASS_C_DEC& other)
159 PB_DS_ASSERT_VALID((*
this))
160 PB_DS_ASSERT_VALID(other)
162 std::swap(m_entries, other.m_entries);
163 std::swap(m_num_e, other.m_num_e);
164 std::swap(m_num_used_e, other.m_num_used_e);
165 ranged_hash_fn_base::swap(other);
166 hash_eq_fn_base::swap(other);
167 resize_base::swap(other);
169 _GLIBCXX_DEBUG_ONLY(debug_base::swap(other));
170 PB_DS_ASSERT_VALID((*this))
171 PB_DS_ASSERT_VALID(other)
180 s_entry_pointer_allocator.deallocate(m_entries, m_num_e);
188 std::fill(m_entries, m_entries + m_num_e, entry_pointer(0));
189 Resize_Policy::notify_resized(m_num_e);
190 Resize_Policy::notify_cleared();
191 ranged_hash_fn_base::notify_resized(m_num_e);