|
| | robin_hash (size_type bucket_count_, const Hash &hash, const KeyEqual &equal, const Allocator &alloc, float max_load_factor_) |
| |
| | robin_hash (const robin_hash &other) |
| |
| | robin_hash (robin_hash &&other) noexcept(std::is_nothrow_move_constructible< Hash >::value &&std::is_nothrow_move_constructible< KeyEqual >::value &&std::is_nothrow_move_constructible< GrowthPolicy >::value &&std::is_nothrow_move_constructible< buckets_container_type >::value) |
| |
| robin_hash & | operator= (const robin_hash &other) |
| |
| robin_hash & | operator= (robin_hash &&other) |
| |
| allocator_type | get_allocator () const |
| |
| iterator | begin () noexcept |
| |
| const_iterator | begin () const noexcept |
| |
| const_iterator | cbegin () const noexcept |
| |
| iterator | end () noexcept |
| |
| const_iterator | end () const noexcept |
| |
| const_iterator | cend () const noexcept |
| |
| bool | empty () const noexcept |
| |
| size_type | size () const noexcept |
| |
| size_type | max_size () const noexcept |
| |
| void | clear () noexcept |
| |
| template<typename P > |
| std::pair< iterator, bool > | insert (P &&value) |
| |
| template<typename P > |
| iterator | insert (const_iterator hint, P &&value) |
| |
| template<class InputIt > |
| void | insert (InputIt first, InputIt last) |
| |
| template<class K , class M > |
| std::pair< iterator, bool > | insert_or_assign (K &&key, M &&obj) |
| |
| template<class K , class M > |
| iterator | insert_or_assign (const_iterator hint, K &&key, M &&obj) |
| |
| template<class... Args> |
| std::pair< iterator, bool > | emplace (Args &&... args) |
| |
| template<class... Args> |
| iterator | emplace_hint (const_iterator hint, Args &&... args) |
| |
| template<class K , class... Args> |
| std::pair< iterator, bool > | try_emplace (K &&key, Args &&... args) |
| |
| template<class K , class... Args> |
| iterator | try_emplace (const_iterator hint, K &&key, Args &&... args) |
| |
| iterator | erase (iterator pos) |
| |
| iterator | erase (const_iterator pos) |
| |
| iterator | erase (const_iterator first, const_iterator last) |
| |
| template<class K > |
| size_type | erase (const K &key) |
| |
| template<class K > |
| size_type | erase (const K &key, std::size_t hash) |
| |
| void | swap (robin_hash &other) |
| |
| template<class K , class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> |
| U::value_type & | at (const K &key) |
| |
| template<class K , class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> |
| U::value_type & | at (const K &key, std::size_t hash) |
| |
| template<class K , class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> |
| const U::value_type & | at (const K &key) const |
| |
| template<class K , class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> |
| const U::value_type & | at (const K &key, std::size_t hash) const |
| |
| template<class K , class U = ValueSelect, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> |
| U::value_type & | operator[] (K &&key) |
| |
| template<class K > |
| size_type | count (const K &key) const |
| |
| template<class K > |
| size_type | count (const K &key, std::size_t hash) const |
| |
| template<class K > |
| iterator | find (const K &key) |
| |
| template<class K > |
| iterator | find (const K &key, std::size_t hash) |
| |
| template<class K > |
| const_iterator | find (const K &key) const |
| |
| template<class K > |
| const_iterator | find (const K &key, std::size_t hash) const |
| |
| template<class K > |
| std::pair< iterator, iterator > | equal_range (const K &key) |
| |
| template<class K > |
| std::pair< iterator, iterator > | equal_range (const K &key, std::size_t hash) |
| |
| template<class K > |
| std::pair< const_iterator, const_iterator > | equal_range (const K &key) const |
| |
| template<class K > |
| std::pair< const_iterator, const_iterator > | equal_range (const K &key, std::size_t hash) const |
| |
| size_type | bucket_count () const |
| |
| size_type | max_bucket_count () const |
| |
| float | load_factor () const |
| |
| float | max_load_factor () const |
| |
| void | max_load_factor (float ml) |
| |
| void | rehash (size_type count_) |
| |
| void | reserve (size_type count_) |
| |
| hasher | hash_function () const |
| |
| key_equal | key_eq () const |
| |
| iterator | mutable_iterator (const_iterator pos) |
| |
|
| template<class K > |
| std::size_t | hash_key (const K &key) const |
| |
| template<class K1 , class K2 > |
| bool | compare_keys (const K1 &key1, const K2 &key2) const |
| |
| std::size_t | bucket_for_hash (std::size_t hash) const |
| |
| template<class U = GrowthPolicy, typename std::enable_if< is_power_of_two_policy< U >::value >::type * = nullptr> |
| std::size_t | next_bucket (std::size_t index) const noexcept |
| |
| template<class U = GrowthPolicy, typename std::enable_if<!is_power_of_two_policy< U >::value >::type * = nullptr> |
| std::size_t | next_bucket (std::size_t index) const noexcept |
| |
| template<class K > |
| iterator | find_impl (const K &key, std::size_t hash) |
| |
| template<class K > |
| const_iterator | find_impl (const K &key, std::size_t hash) const |
| |
| void | erase_from_bucket (iterator pos) |
| |
| template<class K , class... Args> |
| std::pair< iterator, bool > | insert_impl (const K &key, Args &&... value_type_args) |
| |
| template<class... Args> |
| void | insert_value (std::size_t ibucket, distance_type dist_from_ideal_bucket_, truncated_hash_type hash, Args &&... value_type_args) |
| |
| void | insert_value (std::size_t ibucket, distance_type dist_from_ideal_bucket_, truncated_hash_type hash, value_type &&value) |
| |
| void | rehash_impl (size_type count_) |
| |
| void | insert_value_on_rehash (std::size_t ibucket, distance_type dist_from_ideal_bucket_, truncated_hash_type hash, value_type &&value) |
| |
| bool | grow_on_high_load () |
| |
| bucket_entry * | static_empty_bucket_ptr () |
| |
template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, bool StoreHash, class GrowthPolicy>
class tsl::detail_robin_hash::robin_hash< ValueType, KeySelect, ValueSelect, Hash, KeyEqual, Allocator, StoreHash, GrowthPolicy >
Internal common class used by robin_map and robin_set.
ValueType is what will be stored by robin_hash (usually std::pair<Key, T> for map and Key for set).
KeySelect should be a FunctionObject which takes a ValueType in parameter and returns a reference to the key.
ValueSelect should be a FunctionObject which takes a ValueType in parameter and returns a reference to the value. ValueSelect should be void if there is no value (in a set for example).
The strong exception guarantee only holds if the expression std::is_nothrow_swappable<ValueType>::value && std::is_nothrow_move_constructible<ValueType>::value is true.
Behaviour is undefined if the destructor of ValueType throws.
template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, bool StoreHash, class GrowthPolicy>
Here to avoid template<class K> size_type erase(const K& key) being used when we use an iterator instead of a const_iterator.
Erase bucket used a backward shift after clearing the bucket. Check if there is a new value in the bucket, if not get the next non-empty.
template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, bool StoreHash, class GrowthPolicy>
Backward shift, swap the empty bucket, previous_ibucket, with the values on its right, ibucket, until we cross another empty bucket or if the other bucket has a distance_from_ideal_bucket == 0.
We try to move the values closer to their ideal bucket.
template<class ValueType, class KeySelect, class ValueSelect, class Hash, class KeyEqual, class Allocator, bool StoreHash, class GrowthPolicy>
We can only use the hash on rehash if the size of the hash type is the same as the stored one or if we use a power of two modulo. In the case of the power of two modulo, we just mask the least significant bytes, we just have to check that the truncated_hash_type didn't truncated more bytes.