A simple insertion‐ordered set.
Synopsis
Declared in <absl/container/linked_hash_set.h>
template<
typename Key,
typename KeyHash = absl::flat_hash_set<Key>::hasher,
typename KeyEq = absl::flat_hash_set<Key, KeyHash>::key_equal,
typename Alloc = std::allocator<Key>>
class linked_hash_set;
Description
Provides O(1) amortized insertions and lookups, as well as iteration over the set in the insertion order. This class is thread‐compatible but NOT exception‐safe, and 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 difference type. |
|
The hash functor type. |
|
The return type of node‐handle insertions. |
|
The iterator type, iterating in insertion order. |
|
The key equality functor type. |
|
The key type of the set. |
|
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 size type. |
|
The value type stored in the set. |
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
|
|
|
|
Returns the number of buckets in the underlying hash set. |
|
Returns the number of elements the set can hold without rehashing. |
|
Returns a const iterator to the first element, in insertion order. |
|
Returns a const iterator past the last element. |
|
Removes all elements from the set. |
|
Returns whether the set contains an element with the given key. |
|
Returns the number of elements matching the given key. |
|
Returns a const reverse iterator to the last element. |
|
Returns a const reverse iterator past the first element. |
|
Constructs an element in place in the set. |
|
Constructs an element in place in the set using a position hint. |
|
Returns whether the set is empty. |
|
|
|
Returns the range of elements matching the given key. |
|
|
|
|
|
Finds the element with the given key. |
|
|
|
Returns the allocator. |
|
Returns the hash functor. |
|
|
|
Returns the key equality functor. |
|
Returns the current load factor of the underlying hash set. |
|
Returns the maximum number of elements the set can hold. |
|
Merges the elements of another set into this one. |
|
Removes the last element from the set. |
|
Removes the first element from the set. |
|
|
|
Rehashes the underlying hash set to hold at least |
|
|
|
Reserves space for at least |
|
Returns the number of elements in the set. |
|
Swaps the contents of this set with another. |
Friends
Name |
Description |
Returns whether two sets contain different elements. |
|
Returns whether two sets contain the same elements. |
Created with MrDocs