43 hash_standard_resize_policy()
44 : m_size(Size_Policy::get_nearest_larger_size(1))
45 { trigger_policy_base::notify_externally_resized(m_size); }
49 hash_standard_resize_policy(
const Size_Policy& r_size_policy)
50 : Size_Policy(r_size_policy), m_size(Size_Policy::get_nearest_larger_size(1))
51 { trigger_policy_base::notify_externally_resized(m_size); }
55 hash_standard_resize_policy(
const Size_Policy& r_size_policy,
56 const Trigger_Policy& r_trigger_policy)
57 : Size_Policy(r_size_policy), Trigger_Policy(r_trigger_policy),
58 m_size(Size_Policy::get_nearest_larger_size(1))
59 { trigger_policy_base::notify_externally_resized(m_size); }
63 ~hash_standard_resize_policy()
69 swap(PB_DS_CLASS_C_DEC& other)
79 notify_find_search_start()
80 { trigger_policy_base::notify_find_search_start(); }
85 notify_find_search_collision()
86 { trigger_policy_base::notify_find_search_collision(); }
91 notify_find_search_end()
92 { trigger_policy_base::notify_find_search_end(); }
97 notify_insert_search_start()
98 { trigger_policy_base::notify_insert_search_start(); }
103 notify_insert_search_collision()
104 { trigger_policy_base::notify_insert_search_collision(); }
109 notify_insert_search_end()
110 { trigger_policy_base::notify_insert_search_end(); }
115 notify_erase_search_start()
116 { trigger_policy_base::notify_erase_search_start(); }
121 notify_erase_search_collision()
122 { trigger_policy_base::notify_erase_search_collision(); }
127 notify_erase_search_end()
128 { trigger_policy_base::notify_erase_search_end(); }
133 notify_inserted(size_type num_e)
134 { trigger_policy_base::notify_inserted(num_e); }
139 notify_erased(size_type num_e)
140 { trigger_policy_base::notify_erased(num_e); }
146 { trigger_policy_base::notify_cleared(); }
151 is_resize_needed()
const
152 {
return trigger_policy_base::is_resize_needed(); }
155 typename PB_DS_CLASS_C_DEC::size_type
157 get_new_size(size_type
size, size_type num_used_e)
const
159 if (trigger_policy_base::is_grow_needed(size, num_used_e))
160 return size_policy_base::get_nearest_larger_size(size);
161 return size_policy_base::get_nearest_smaller_size(size);
167 notify_resized(size_type new_size)
169 trigger_policy_base::notify_resized(new_size);
174 inline typename PB_DS_CLASS_C_DEC::size_type
176 get_actual_size()
const
178 PB_DS_STATIC_ASSERT(access, external_size_access);
185 resize(size_type new_size)
187 PB_DS_STATIC_ASSERT(access, external_size_access);
188 size_type actual_size = size_policy_base::get_nearest_larger_size(1);
189 while (actual_size < new_size)
191 const size_type pot = size_policy_base::get_nearest_larger_size(actual_size);
193 if (pot == actual_size && pot < new_size)
194 __throw_resize_error();
201 const size_type old_size = m_size;
204 do_resize(actual_size - 1);
206 __catch(insert_error& )
209 __throw_resize_error();
214 __throw_exception_again;
233 const Trigger_Policy&
235 get_trigger_policy()
const
247 get_size_policy()
const
constexpr size_t size() const noexcept
Returns the total number of bits.
void swap(function< _Res(_Args...)> &__x, function< _Res(_Args...)> &__y)
Swap the targets of two polymorphic function object wrappers.