[#absl-linked_hash_set] = xref:absl.adoc[absl]::linked_hash_set :relfileprefix: ../ :mrdocs: A simple insertion‐ordered set. == Synopsis Declared in `<absl/container/linked_hash_set.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | Name| Description | xref:absl/linked_hash_set/allocator_type.adoc[`allocator_type`] | The allocator type. | xref:absl/linked_hash_set/const_iterator.adoc[`const_iterator`] | The const iterator type, iterating in insertion order. | xref:absl/linked_hash_set/const_pointer.adoc[`const_pointer`] | A const pointer to an element. | xref:absl/linked_hash_set/const_reference.adoc[`const_reference`] | A const reference to an element. | xref:absl/linked_hash_set/const_reverse_iterator.adoc[`const_reverse_iterator`] | The const reverse iterator type. | xref:absl/linked_hash_set/difference_type.adoc[`difference_type`] | The signed integer difference type. | xref:absl/linked_hash_set/hasher.adoc[`hasher`] | The hash functor type. | xref:absl/linked_hash_set/insert_return_type.adoc[`insert_return_type`] | The return type of node‐handle insertions. | xref:absl/linked_hash_set/iterator.adoc[`iterator`] | The iterator type, iterating in insertion order. | xref:absl/linked_hash_set/key_equal.adoc[`key_equal`] | The key equality functor type. | xref:absl/linked_hash_set/key_type.adoc[`key_type`] | The key type of the set. | xref:absl/linked_hash_set/node_type.adoc[`node_type`] | The node handle type used to extract and reinsert elements. | xref:absl/linked_hash_set/pointer.adoc[`pointer`] | A pointer to an element. | xref:absl/linked_hash_set/reference.adoc[`reference`] | A reference to an element. | xref:absl/linked_hash_set/reverse_iterator.adoc[`reverse_iterator`] | The reverse iterator type. | xref:absl/linked_hash_set/size_type.adoc[`size_type`] | The unsigned integer size type. | xref:absl/linked_hash_set/value_type.adoc[`value_type`] | The value type stored in the set. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:absl/linked_hash_set/2constructor-0168.adoc[`linked_hash_set`] [.small]#[constructor]# | Constructors | xref:absl/linked_hash_set/operator_assign-06.adoc[`operator=`] | Assignment operators | xref:absl/linked_hash_set/back-0f4.adoc[`back`] | `back` overloads | xref:absl/linked_hash_set/begin-0c.adoc[`begin`] | `begin` overloads | xref:absl/linked_hash_set/bucket_count.adoc[`bucket_count`] | Returns the number of buckets in the underlying hash set. | xref:absl/linked_hash_set/capacity.adoc[`capacity`] | Returns the number of elements the set can hold without rehashing. | xref:absl/linked_hash_set/cbegin.adoc[`cbegin`] | Returns a const iterator to the first element, in insertion order. | xref:absl/linked_hash_set/cend.adoc[`cend`] | Returns a const iterator past the last element. | xref:absl/linked_hash_set/clear.adoc[`clear`] | Removes all elements from the set. | xref:absl/linked_hash_set/contains.adoc[`contains`] | Returns whether the set contains an element with the given key. | xref:absl/linked_hash_set/count.adoc[`count`] | Returns the number of elements matching the given key. | xref:absl/linked_hash_set/crbegin.adoc[`crbegin`] | Returns a const reverse iterator to the last element. | xref:absl/linked_hash_set/crend.adoc[`crend`] | Returns a const reverse iterator past the first element. | xref:absl/linked_hash_set/emplace.adoc[`emplace`] | Constructs an element in place in the set. | xref:absl/linked_hash_set/emplace_hint.adoc[`emplace_hint`] | Constructs an element in place in the set using a position hint. | xref:absl/linked_hash_set/empty.adoc[`empty`] | Returns whether the set is empty. | xref:absl/linked_hash_set/end-0c6.adoc[`end`] | `end` overloads | xref:absl/linked_hash_set/equal_range-055.adoc[`equal_range`] | Returns the range of elements matching the given key. | xref:absl/linked_hash_set/erase-09.adoc[`erase`] | `erase` overloads | xref:absl/linked_hash_set/extract-0ca.adoc[`extract`] | `extract` overloads | xref:absl/linked_hash_set/find-0b.adoc[`find`] | Finds the element with the given key. | xref:absl/linked_hash_set/front-06.adoc[`front`] | `front` overloads | xref:absl/linked_hash_set/get_allocator.adoc[`get_allocator`] | Returns the allocator. | xref:absl/linked_hash_set/hash_function.adoc[`hash_function`] | Returns the hash functor. | xref:absl/linked_hash_set/insert-03e.adoc[`insert`] | `insert` overloads | xref:absl/linked_hash_set/key_eq.adoc[`key_eq`] | Returns the key equality functor. | xref:absl/linked_hash_set/load_factor.adoc[`load_factor`] | Returns the current load factor of the underlying hash set. | xref:absl/linked_hash_set/max_size.adoc[`max_size`] | Returns the maximum number of elements the set can hold. | xref:absl/linked_hash_set/merge-03.adoc[`merge`] | Merges the elements of another set into this one. | xref:absl/linked_hash_set/pop_back.adoc[`pop_back`] | Removes the last element from the set. | xref:absl/linked_hash_set/pop_front.adoc[`pop_front`] | Removes the first element from the set. | xref:absl/linked_hash_set/rbegin-0a.adoc[`rbegin`] | `rbegin` overloads | xref:absl/linked_hash_set/rehash.adoc[`rehash`] | Rehashes the underlying hash set to hold at least `n` buckets. | xref:absl/linked_hash_set/rend-01.adoc[`rend`] | `rend` overloads | xref:absl/linked_hash_set/reserve.adoc[`reserve`] | Reserves space for at least `n` elements. | xref:absl/linked_hash_set/size.adoc[`size`] | Returns the number of elements in the set. | xref:absl/linked_hash_set/swap.adoc[`swap`] | Swaps the contents of this set with another. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:absl/operator_not_eq-0563.adoc[absl::operator!=]` | Returns whether two sets contain different elements. | `xref:absl/operator_eq-08e.adoc[absl::operator==]` | Returns whether two sets contain the same elements. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#