[#bsl-unordered_map-02b]
= xref:bsl.adoc[bsl]::unordered&lowbar;map
:relfileprefix: ../
:mrdocs:

Unordered associative container mapping unique keys to values&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class VALUE,
    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;bsl::pair&lt;KEY const, VALUE&gt;&gt;]&gt;
class unordered&lowbar;map;
----

== Description

This class template implements a value&hyphen;semantic container type holding an unordered set of `KEY&hyphen;VALUE` pairs having unique keys that provide a mapping from keys (of template parameter type `KEY`) to their associated mapped values (of template parameter type `VALUE`)&period;

This class&colon; &ast; supports a complete set of _value&hyphen;semantic_ operations &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_map-02b/allocator_type.adoc[`allocator&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `ALLOCATOR`&period;
| xref:bsl/unordered_map-02b/const_iterator.adoc[`const&lowbar;iterator`] 
| This `typedef` is an alias to `HashTableIterator&lt;const value&lowbar;type&gt;`&period;
| xref:bsl/unordered_map-02b/const_local_iterator.adoc[`const&lowbar;local&lowbar;iterator`] 
| This `typedef` is an alias to `HashTableBucketIterator&lt;const value&lowbar;type&gt;`&period;
| xref:bsl/unordered_map-02b/const_pointer.adoc[`const&lowbar;pointer`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;const&lowbar;pointer`&period;
| xref:bsl/unordered_map-02b/const_reference.adoc[`const&lowbar;reference`] 
| This `typedef` is an alias to `const value&lowbar;type&amp;`&period;
| xref:bsl/unordered_map-02b/difference_type.adoc[`difference&lowbar;type`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;difference&lowbar;type`&period;
| xref:bsl/unordered_map-02b/hasher.adoc[`hasher`] 
| This `typedef` is an alias to the (template parameter) `HASH`&period;
| xref:bsl/unordered_map-02b/iterator.adoc[`iterator`] 
| This `typedef` is an alias to `HashTableIterator&lt;value&lowbar;type&gt;`&period;
| xref:bsl/unordered_map-02b/key_equal.adoc[`key&lowbar;equal`] 
| This `typedef` is an alias to the (template parameter) `EQUAL`&period;
| xref:bsl/unordered_map-02b/key_type.adoc[`key&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `KEY`&period;
| xref:bsl/unordered_map-02b/local_iterator.adoc[`local&lowbar;iterator`] 
| This `typedef` is an alias to `HashTableBucketIterator&lt;value&lowbar;type&gt;`&period;
| xref:bsl/unordered_map-02b/mapped_type.adoc[`mapped&lowbar;type`] 
| This `typedef` is an alias to the (template parameter) `VALUE`&period;
| xref:bsl/unordered_map-02b/pointer.adoc[`pointer`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;pointer`&period;
| xref:bsl/unordered_map-02b/reference.adoc[`reference`] 
| This `typedef` is an alias to `value&lowbar;type&amp;`&period;
| xref:bsl/unordered_map-02b/size_type.adoc[`size&lowbar;type`] 
| This `typedef` is an alias to `AllocatorTraits&colon;&colon;size&lowbar;type`&period;
| xref:bsl/unordered_map-02b/value_type.adoc[`value&lowbar;type`] 
| This `typedef` is an alias to `bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_map-02b/2constructor-0f0.adoc[`unordered&lowbar;map`]         [.small]#[constructor]#
| Constructors
| xref:bsl/unordered_map-02b/2destructor.adoc[`&#126;unordered&lowbar;map`] [.small]#[destructor]#
| Destroy this object and each of its elements&period;
| xref:bsl/unordered_map-02b/operator_assign-08.adoc[`operator&equals;`] 
| Assignment operators
| xref:bsl/unordered_map-02b/at-0f.adoc[`at`] 
| `at` overloads
| xref:bsl/unordered_map-02b/begin-0a.adoc[`begin`] 
| `begin` overloads
| xref:bsl/unordered_map-02b/bucket-02.adoc[`bucket`] 
| `bucket` overloads
| xref:bsl/unordered_map-02b/bucket_count.adoc[`bucket&lowbar;count`] 
| Return the number of buckets in the array of buckets maintained by this unordered map&period;
| xref:bsl/unordered_map-02b/bucket_size.adoc[`bucket&lowbar;size`] 
| Return the number of elements in the bucket at `index`&period;
| xref:bsl/unordered_map-02b/cbegin-03.adoc[`cbegin`] 
| `cbegin` overloads
| xref:bsl/unordered_map-02b/cend-09.adoc[`cend`] 
| `cend` overloads
| xref:bsl/unordered_map-02b/clear.adoc[`clear`] 
| Remove all entries from this unordered map&period;
| xref:bsl/unordered_map-02b/contains-0a.adoc[`contains`] 
| `contains` overloads
| xref:bsl/unordered_map-02b/count-08.adoc[`count`] 
| `count` overloads
| xref:bsl/unordered_map-02b/emplace.adoc[`emplace`] 
| Emplace a newly constructed element if its key is not already present&period;
| xref:bsl/unordered_map-02b/emplace_hint.adoc[`emplace&lowbar;hint`] 
| Emplace a newly constructed element at `hint` if its key is missing&period;
| xref:bsl/unordered_map-02b/empty.adoc[`empty`] 
| Return `true` if this unordered map contains no elements, and `false` otherwise&period;
| xref:bsl/unordered_map-02b/end-07c.adoc[`end`] 
| `end` overloads
| xref:bsl/unordered_map-02b/equal_range-05.adoc[`equal&lowbar;range`] 
| `equal&lowbar;range` overloads
| xref:bsl/unordered_map-02b/erase-000.adoc[`erase`] 
| `erase` overloads
| xref:bsl/unordered_map-02b/find-0a.adoc[`find`] 
| `find` overloads
| xref:bsl/unordered_map-02b/get_allocator.adoc[`get&lowbar;allocator`] 
| Return (a copy of) the allocator used for memory allocation by this unordered map&period;
| xref:bsl/unordered_map-02b/hash_function.adoc[`hash&lowbar;function`] 
| Return (a copy of) the unary hash functor used by this unordered map to generate a hash value (of type `size&lowbar;type`) for a `key&lowbar;type` object&period;
| xref:bsl/unordered_map-02b/insert-03.adoc[`insert`] 
| `insert` overloads
| xref:bsl/unordered_map-02b/insert_or_assign-068.adoc[`insert&lowbar;or&lowbar;assign`] 
| `insert&lowbar;or&lowbar;assign` overloads
| xref:bsl/unordered_map-02b/insert_range.adoc[`insert&lowbar;range`] 
| Insert each element of `range` whose key is not already present&period;
| xref:bsl/unordered_map-02b/key_eq.adoc[`key&lowbar;eq`] 
| Return (a copy of) binary the key&hyphen;equality functor used by this unordered map that returns `true` if two `key&lowbar;type` objects are equivalent, and `false` otherwise&period;
| xref:bsl/unordered_map-02b/load_factor.adoc[`load&lowbar;factor`] 
| Return the current load factor of this unordered map&period;
| xref:bsl/unordered_map-02b/max_bucket_count.adoc[`max&lowbar;bucket&lowbar;count`] 
| Return a theoretical upper bound on the number of buckets&period;
| xref:bsl/unordered_map-02b/max_load_factor-0a.adoc[`max&lowbar;load&lowbar;factor`] 
| `max&lowbar;load&lowbar;factor` overloads
| xref:bsl/unordered_map-02b/max_size.adoc[`max&lowbar;size`] 
| Return a theoretical upper bound on the size of this unordered map&period;
| xref:bsl/unordered_map-02b/operator_subs-01.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:bsl/unordered_map-02b/rehash.adoc[`rehash`] 
| Rehash this unordered map to at least `numBuckets` buckets&period;
| xref:bsl/unordered_map-02b/reserve.adoc[`reserve`] 
| Reserve capacity for at least `numElements` without rehashing&period;
| xref:bsl/unordered_map-02b/size.adoc[`size`] 
| Return the number of elements in this unordered map&period;
| xref:bsl/unordered_map-02b/swap.adoc[`swap`] 
| Exchange the contents of this object with those of `other`&period;
| xref:bsl/unordered_map-02b/try_emplace-050.adoc[`try&lowbar;emplace`] 
| `try&lowbar;emplace` overloads
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_map-049.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-0c.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-0d.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-099.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-08b.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-045.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-0b4.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-01f.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-014.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-0ea.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-05d.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-0e6.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-021.adoc[`unordered&lowbar;map&lt;KEY, VALUE, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-09a.adoc[`unordered&lowbar;map&lt;KEY, VALUE, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from initializer&lowbar;list `value&lowbar;type`&period;
| xref:bsl/unordered_map-051.adoc[`unordered&lowbar;map&lt;KEY, VALUE, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
| xref:bsl/unordered_map-080.adoc[`unordered&lowbar;map&lt;KEY, VALUE, bsl::hash&lt;KEY&gt;, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| CTAD guide&colon; deduce `KEY` and `VALUE` from iterator `value&lowbar;type`&period;
|===


== Friends

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

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/erase_if-0a4.adoc[`erase&lowbar;if`]
| Erase every element of `m` that satisfies `predicate`&period;
| xref:bsl/operator_eq-024.adoc[`operator&equals;&equals;`]
| Return `true` if `lhs` and `rhs` have the same value, and `false` otherwise&period;
| xref:bsl/swap-04c.adoc[`swap`]
| Exchange the contents of `a` with those of `b`&period;
|===


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