[#bsl-unordered_set-0d2d]
= xref:bsl.adoc[bsl]::unordered&lowbar;set
:relfileprefix: ../
:mrdocs:

This class template implements a value&hyphen;semantic container type holding an unordered set of unique values (of template parameter type `KEY`)&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;unorderedset&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class HASH = xref:bsl/hash-06.adoc[bsl::hash&lt;KEY&gt;],
    class EQUAL = xref:bsl/equal_to-0d.adoc[bsl::equal&lowbar;to&lt;KEY&gt;],
    class ALLOCATOR = xref:bsl/allocator-0df.adoc[bsl::allocator&lt;KEY&gt;]&gt;
class unordered&lowbar;set;
----

== Description

This class&colon; &ast; supports a complete set of _value&hyphen;semantic_ operations

* except for BDEX serialization &ast; is _exception&hyphen;neutral_ (agnostic except for the `at` method) &ast; is _alias&hyphen;safe_ &ast; is `const` _thread&hyphen;safe_ For terminology see &lcub;`bsldoc&lowbar;glossary`&rcub;&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_set-0d2d/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `ALLOCATOR`&period;
| xref:bsl/unordered_set-0d2d/const_iterator.adoc[`const&lowbar;iterator`] 
| This `typedef` is an alias to `iterator`&period;
| xref:bsl/unordered_set-0d2d/const_local_iterator.adoc[`const&lowbar;local&lowbar;iterator`] 
| This `typedef` is an alias to `local&lowbar;iterator`&period;
| xref:bsl/unordered_set-0d2d/const_pointer.adoc[`const&lowbar;pointer`] 
| This `typedef` is an alias to the allocator const&hyphen;pointer type&period;
| xref:bsl/unordered_set-0d2d/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias to `const value&lowbar;type&amp;`&period;
| xref:bsl/unordered_set-0d2d/difference_type.adoc[`difference&lowbar;type`] 
| This `typedef` is an alias to the allocator difference type&period;
| xref:bsl/unordered_set-0d2d/hasher.adoc[`hasher`] 
| This `typedef` is an alias to the (template parameter) `HASH` type&period;
| xref:bsl/unordered_set-0d2d/iterator.adoc[`iterator`] 
| This `typedef` is an alias to the hash&hyphen;table iterator type&period;
| xref:bsl/unordered_set-0d2d/key_equal.adoc[`key&lowbar;equal`] 
| This `typedef` is an alias to the (template parameter) `EQUAL` type&period;
| xref:bsl/unordered_set-0d2d/key_type.adoc[`key&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `KEY` type&period;
| xref:bsl/unordered_set-0d2d/local_iterator.adoc[`local&lowbar;iterator`] 
| This `typedef` is an alias for `local&lowbar;iterator`&period;
| xref:bsl/unordered_set-0d2d/pointer.adoc[`pointer`] 
| This `typedef` is an alias to the allocator pointer type&period;
| xref:bsl/unordered_set-0d2d/reference.adoc[`reference`] 
| This `typedef` is an alias to `value&lowbar;type&amp;`&period;
| xref:bsl/unordered_set-0d2d/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to the allocator size type&period;
| xref:bsl/unordered_set-0d2d/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias to `key&lowbar;type`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_set-0d2d/2constructor-059.adoc[`unordered&lowbar;set`]         [.small]#[constructor]#
| Constructors
| xref:bsl/unordered_set-0d2d/2destructor.adoc[`&#126;unordered&lowbar;set`] [.small]#[destructor]#
| Destroy this object&period;
| xref:bsl/unordered_set-0d2d/operator_assign-0e.adoc[`operator&equals;`] 
| Assignment operators
| xref:bsl/unordered_set-0d2d/begin-0f.adoc[`begin`] 
| `begin` overloads
| xref:bsl/unordered_set-0d2d/bucket-0d.adoc[`bucket`] 
| Return the bucket index for the specified `key`&period;
| xref:bsl/unordered_set-0d2d/bucket_count.adoc[`bucket&lowbar;count`] 
| Return the number of buckets in the array of buckets maintained by this set&period;
| xref:bsl/unordered_set-0d2d/bucket_size.adoc[`bucket&lowbar;size`] 
| Return the number of elements in the bucket at `index`&period;
| xref:bsl/unordered_set-0d2d/cbegin-07.adoc[`cbegin`] 
| `cbegin` overloads
| xref:bsl/unordered_set-0d2d/cend-0c.adoc[`cend`] 
| `cend` overloads
| xref:bsl/unordered_set-0d2d/clear.adoc[`clear`] 
| Remove all entries from this unordered set&period; Note that the set is empty after this call, but allocated memory may be retained for future use&period;
| xref:bsl/unordered_set-0d2d/contains-05.adoc[`contains`] 
| `contains` overloads
| xref:bsl/unordered_set-0d2d/count-0ca.adoc[`count`] 
| Return the number of elements equivalent to `key`&period;
| xref:bsl/unordered_set-0d2d/emplace.adoc[`emplace`] 
| Emplace a newly constructed element if the key is missing&period;
| xref:bsl/unordered_set-0d2d/emplace_hint.adoc[`emplace&lowbar;hint`] 
| Emplace a newly constructed element using `hint` if the key is missing&period;
| xref:bsl/unordered_set-0d2d/empty.adoc[`empty`] 
| Return `true` if this set contains no elements, and `false` otherwise&period;
| xref:bsl/unordered_set-0d2d/end-0b.adoc[`end`] 
| `end` overloads
| xref:bsl/unordered_set-0d2d/equal_range-04f.adoc[`equal&lowbar;range`] 
| Return the range of elements equivalent to `key`&period;
| xref:bsl/unordered_set-0d2d/erase-02.adoc[`erase`] 
| `erase` overloads
| xref:bsl/unordered_set-0d2d/find-00e.adoc[`find`] 
| Return an iterator to the element equivalent to `key`&period;
| xref:bsl/unordered_set-0d2d/get_allocator.adoc[`get&lowbar;allocator`] 
| Return (a copy of) the allocator used for memory allocation by this unordered set&period;
| xref:bsl/unordered_set-0d2d/hash_function.adoc[`hash&lowbar;function`] 
| Return (a copy of) the hash unary functor used by this set to generate a hash value (of type `size&lowbar;t`) for a `key&lowbar;type` object&period;
| xref:bsl/unordered_set-0d2d/insert-0c.adoc[`insert`] 
| `insert` overloads
| xref:bsl/unordered_set-0d2d/insert_range.adoc[`insert&lowbar;range`] 
| Insert values from `range` if their keys are missing&period;
| xref:bsl/unordered_set-0d2d/key_eq.adoc[`key&lowbar;eq`] 
| Return (a copy of) the key&hyphen;equality binary functor that returns `true` if the value of two `key&lowbar;type` objects are equivalent, and `false` otherwise&period;
| xref:bsl/unordered_set-0d2d/load_factor.adoc[`load&lowbar;factor`] 
| Return the current load factor of this container&period;
| xref:bsl/unordered_set-0d2d/max_bucket_count.adoc[`max&lowbar;bucket&lowbar;count`] 
| Return a theoretical upper bound on the number of buckets&period;
| xref:bsl/unordered_set-0d2d/max_load_factor-05.adoc[`max&lowbar;load&lowbar;factor`] 
| `max&lowbar;load&lowbar;factor` overloads
| xref:bsl/unordered_set-0d2d/max_size.adoc[`max&lowbar;size`] 
| Return a theoretical upper bound on this set&apos;s size&period;
| xref:bsl/unordered_set-0d2d/rehash.adoc[`rehash`] 
| Rehash this set to have at least `numBuckets` buckets&period;
| xref:bsl/unordered_set-0d2d/reserve.adoc[`reserve`] 
| Reserve capacity for at least `numElements` elements&period;
| xref:bsl/unordered_set-0d2d/size.adoc[`size`] 
| Return the number of elements in this set&period;
| xref:bsl/unordered_set-0d2d/swap.adoc[`swap`] 
| Exchange the contents of this set with `other`&period;
| xref:bsl/unordered_set-0d2d/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;unordered&lowbar;set, IsBitwiseMoveable, &colon;&colon;BloombergLP&colon;&colon;bslmf&colon;&colon;IsBitwiseMoveable&lt;HashTable&gt;&colon;&colon;value&gt;`] 
| Return the nested trait declaration for `bslmf&colon;&colon;IsBitwiseMoveable`&period;
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_set-0c5.adoc[`unordered&lowbar;set&lt;KEY&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-0b5.adoc[`unordered&lowbar;set&lt;KEY&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-0f.adoc[`unordered&lowbar;set&lt;KEY&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-05.adoc[`unordered&lowbar;set&lt;KEY&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-0d25.adoc[`unordered&lowbar;set&lt;KEY, HASH&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-0c2.adoc[`unordered&lowbar;set&lt;KEY, HASH&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-088.adoc[`unordered&lowbar;set&lt;KEY, HASH, EQUAL&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-02f.adoc[`unordered&lowbar;set&lt;KEY, HASH, EQUAL&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-0b4.adoc[`unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-0e.adoc[`unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-07.adoc[`unordered&lowbar;set&lt;KEY, HASH, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-087.adoc[`unordered&lowbar;set&lt;KEY, HASH, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-048.adoc[`unordered&lowbar;set&lt;KEY, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-0d0.adoc[`unordered&lowbar;set&lt;KEY, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_set-0ce.adoc[`unordered&lowbar;set&lt;KEY, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_set-04b.adoc[`unordered&lowbar;set&lt;KEY, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` from iterator `value&lowbar;type`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/operator_eq-087.adoc[bsl::operator&equals;&equals;]`
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/erase_if-0d.adoc[`erase&lowbar;if`]
| Erase elements from `s` that satisfy `predicate`&period;
| xref:bsl/operator_eq-0b3.adoc[`operator&equals;&equals;`]
| Return `true` if `lhs` and `rhs` have the same value, and `false` otherwise&period;
| xref:bsl/swap-05b.adoc[`swap`]
| Exchange the contents of `a` and `b`&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
