46# include <type_traits>
50# define OHASH_COMMON(class_name) \
53 Hash_Fct get_hash_fct() const noexcept { return hash_fct; } \
60 Key * test_resize(Bucket * curr_bucket, const Key & key) \
62 const size_t new_len = this->capacity_after_insertion(); \
64 return &curr_bucket->key; \
66 return rebuild_after_insertion(curr_bucket, key, new_len); \
73 Key * rebuild_after_insertion(Bucket * curr_bucket, const Key & key, \
74 const size_t new_len) \
79 this->rebuild(new_len); \
81 Key * key_ptr = search(key_copy); \
82 assert(key_ptr != nullptr); \
83 assert(cmp(*key_ptr, key_copy)); \
90 this->undo_allocate_bucket(curr_bucket, curr_bucket->key); \
95 static void update_stat_len(DynArray<size_t> & lens, size_t i) \
108 void set_hash_fct(Hash_Fct fct) \
110 Hash_Fct old = std::move(hash_fct); \
111 hash_fct = std::move(fct); \
121 hash_fct = std::move(old); \
126 void set_hash_fct(Hash_Fct_Ptr fct) \
128 set_hash_fct(Hash_Fct(fct)); \
138 namespace hash_table_detail
152 template <
typename H,
typename Ptr>
154 std::is_class_v<std::remove_cvref_t<H>>
and std::is_convertible_v<H, Ptr>;
Standard functor implementations and comparison objects.
A class type that converts to the function pointer type Ptr.
Main namespace for Aleph-w library functions.
const float hash_default_upper_alpha
and
Check uniqueness with explicit hash + equality functors.
const float hash_default_lower_alpha