An insertion‐ordered map.
Synopsis
Declared in <absl/container/linked_hash_map.h>
template<
typename Key,
typename Value,
typename KeyHash = absl::flat_hash_set<Key>::hasher,
typename KeyEq = absl::flat_hash_set<Key, KeyHash>::key_equal,
typename Alloc = std::allocator<std::pair<Key const, Value>>>
class linked_hash_map;
Description
Provides O(1) amortized insertions and lookups, as well as iteration over the map in the insertion order. This class is thread‐compatible, but not exception‐safe. It supports heterogeneous lookups.
Type Aliases
Name |
Description |
The allocator type. |
|
The const iterator type, iterating in insertion order. |
|
A const pointer to an element. |
|
A const reference to an element. |
|
The const reverse iterator type. |
|
The signed integer type for iterator differences. |
|
The hash function type for keys. |
|
The return type of node‐handle insertions. |
|
The iterator type, iterating in insertion order. |
|
The equality comparison type for keys. |
|
The key type. |
|
The mapped value type. |
|
The node handle type used to extract and reinsert elements. |
|
A pointer to an element. |
|
A reference to an element. |
|
The reverse iterator type. |
|
The unsigned integer type for sizes. |
|
The stored element type, a key/value pair. |
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
|
|
|
|
|
|
Returns the number of buckets in the underlying hash set. |
|
Returns the number of elements the map can hold without rehashing. |
|
Returns a const iterator to the first element. |
|
Returns a const iterator past the last element. |
|
Removes all elements from the map. |
|
Returns whether the map contains an element with the given key. |
|
Returns the number of elements with the given key. |
|
Returns a const reverse iterator to the last element. |
|
Returns a const reverse iterator before the first element. |
|
Constructs an element in place if the key is not already present. |
|
Constructs an element in place if the key is not present, ignoring the position hint. |
|
Returns whether the map is empty. |
|
|
|
Returns the range of elements matching the given key. |
|
|
|
|
|
Finds the element with the given key. |
|
|
|
Returns the allocator used by the map. |
|
Returns the hash function used by the map. |
|
|
|
|
|
Returns the key equality comparison used by the map. |
|
Returns the current load factor of the underlying hash set. |
|
Returns the maximum number of elements the map can hold. |
|
Merges the elements of another map into this one. |
|
Returns a reference to the value mapped to the given key, inserting a default‐constructed value if the key is not present. |
|
Removes the last element from the map. |
|
Removes the first element from the map. |
|
|
|
Rehashes the map so it can hold at least |
|
|
|
Reserves capacity for at least |
|
Returns the number of elements in the map. |
|
Moves an element from another map into this one at the given position. |
|
Swaps the contents of this map with another. |
|
|
Friends
Name |
Description |
Returns whether two maps differ in their key/value pairs. |
|
Returns whether two maps contain the same key/value pairs. |
Created with MrDocs