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

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;

== 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&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 contained in the bucket at the specified `index` in the array of buckets maintained by this unordered map&period; The behavior is undefined unless `index &lt; bucket&lowbar;count()`&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; Note that this unordered map will be empty after calling this method, but allocated memory may be retained for future use&period;
| xref:bsl/unordered_map-02b/contains-0a.adoc[`contains`] 
| Return `true` if this unordered map contains an element whose key is equivalent to the specified `key`&period;
| xref:bsl/unordered_map-02b/count-08.adoc[`count`] 
| `count` overloads
| xref:bsl/unordered_map-02b/emplace.adoc[`emplace`] 
| Insert into this unordered map a newly&hyphen;created `value&lowbar;type` object, constructed by forwarding `get&lowbar;allocator()` (if required) and the specified (variable number of) `args` to the corresponding constructor of `value&lowbar;type`, if a key equivalent to such a value does not already exist in this map&semi; otherwise, this method has no effect (other than possibly creating a temporary `value&lowbar;type` object)&period; Return a pair whose `first` member is an iterator referring to the (possibly newly created and inserted) object in this map whose key is equivalent to that of an object constructed from `args`, and whose `second` member is `true` if a new value was inserted, and `false` if an equivalent key was already present&period; This method requires that the (template parameter) types `KEY` and `VALUE` both be `emplace&hyphen;constructible` from `args` (see &lcub;Requirements on `value&lowbar;type`&rcub;)&period;
| xref:bsl/unordered_map-02b/emplace_hint.adoc[`emplace&lowbar;hint`] 
| Insert into this unordered map a newly&hyphen;created `value&lowbar;type` object, constructed by forwarding `get&lowbar;allocator()` (if required) and the specified (variable number of) `args` to the corresponding constructor of `value&lowbar;type`, if a key equivalent to such a value does not already exist in this map&semi; otherwise, this method has no effect (other than possibly creating a temporary `value&lowbar;type` object)&period; Return an iterator referring to the (possibly newly created and inserted) object in this map whose key is equivalent to that of an object constructed from `args`&period; The average and worst case complexity of this operation is not affected by the specified `hint`&period; This method requires that the (template parameter) types `KEY` and `VALUE` both be `emplace&hyphen;constructible` from `args` (see &lcub;Requirements on `value&lowbar;type`&rcub;)&period; The behavior is undefined unless `hint` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included)&period; Note that `hint` is ignored (other than possibly asserting its validity in some build modes)&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 into this map the value of each `value&lowbar;type` object in the specified `range` if a key equivalent to the object is not already contained in this set&period; The (template parameter) type `RANGE` must meet the requirements the C&plus;&plus;20 standard &lsqb;ranges&rsqb;providing access to values of a type convertible to `value&lowbar;type`, and `value&lowbar;type` must be `emplace&hyphen;constructible` from `&ast;i` into this set, where `i` is a dereferenceable iterator obtained from `range` (see &lcub;Requirements on `KEY`&rcub;)&period; The behavior is undefined if `range` overlaps this map&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 ratio between the `size` of this unordered map and the number of buckets&period; The load factor is a measure of how full the container is, and a higher load factor typically leads to an increased number of collisions, thus resulting in a loss of performance&period;
| xref:bsl/unordered_map-02b/max_bucket_count.adoc[`max&lowbar;bucket&lowbar;count`] 
| Return a theoretical upper bound on the largest number of buckets that this unordered map could possibly manage&period; Note that there is no guarantee that the unordered map can successfully grow to the returned size, or even close to that size, without running out of resources&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 largest number of elements that this unordered map could possibly hold&period; Note that there is no guarantee that the unordered map can successfully grow to the returned size, or even close to that size, without running out of resources&period;
| xref:bsl/unordered_map-02b/operator_subs-01.adoc[`operator&lsqb;&rsqb;`] 
| Subscript operators
| xref:bsl/unordered_map-02b/rehash.adoc[`rehash`] 
| Change the size of the array of buckets maintained by this unordered map to at least the specified `numBuckets`, and redistribute all the contained elements into the new sequence of buckets, according to their hash values&period; After this call, `load&lowbar;factor` will be less than or equal to `max&lowbar;load&lowbar;factor`&period; This operation has no effect if rehashing the elements into `numBuckets` would cause this map to exceed its `max&lowbar;load&lowbar;factor`&period;
| xref:bsl/unordered_map-02b/reserve.adoc[`reserve`] 
| Increase the number of buckets of this set to a quantity such that the ratio between the specified `numElements` and this quantity does not exceed `max&lowbar;load&lowbar;factor`&period; Note that this guarantees that, after the reserve, elements can be inserted to grow the container to `size() &equals;&equals; numElements` without rehashing&period; Also note that memory allocations may still occur when growing the container to &grave;size() &equals;&equals; numElements&grave;&period; Also note that this operation has no effect if `numElements &lt;&equals; size()`&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 value, hasher, key&hyphen;equality functor, and `max&lowbar;load&lowbar;factor` of this object with those of the specified `other` object&semi; also exchange the allocator of this object with that of `other` if the (template parameter) type `ALLOCATOR` has the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait, and do not modify either allocator otherwise&period; This method provides the no&hyphen;throw exception&hyphen;safety guarantee if and only if both the (template parameter) types `HASH` and `EQUAL` provide no&hyphen;throw swap operations&semi; if an exception is thrown, both objects are left in valid but unspecified states&period; This operation guarantees `O&lsqb;1&rsqb;` complexity&period; The behavior is undefined unless either this object was created with the same allocator as `other` or `ALLOCATOR` has the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait&period;
| xref:bsl/unordered_map-02b/try_emplace-050.adoc[`try&lowbar;emplace`] 
| `try&lowbar;emplace` overloads
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_map-0bf.adoc[`unordered&lowbar;map&lt;basic&lowbar;string&lt;char&gt;, Json, TransparentHash, TransparentEqualTo&gt;`] 
| 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;
|===


== Deduction Guides

[cols="1,4"]
|===
| Name| Description
| xref:bsl/unordered_map-049.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-0c.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-0d.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-099.adoc[`unordered&lowbar;map&lt;KEY, VALUE&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-08b.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameter `HASH` from the other parameters supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-045.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameter `HASH` from the other parameters passed to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-0b4.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameters `HASH` and `EQUAL` from the other parameters supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-01f.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameters `HASH` and &quot;EQUAL&apos; from the other parameters passed to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator is convertible to `bsl&colon;&colon;allocator&lt;bsl&colon;&colon;pair&lt;const KEY, VALUE&gt;&gt;`&period;
| xref:bsl/unordered_map-014.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL, ALLOCATOR&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameters `HASH`, `EQUAL` and `ALLOCATOR` from the other parameters supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless&colon; (1) the supplied `HASH` is invokable with a `KEY`, (2) the supplied `EQUAL` is invokable with two `KEY`s, and (3) the supplied allocator meets the requirements of a standard allocator&period;
| xref:bsl/unordered_map-0ea.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, EQUAL, ALLOCATOR&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameters `HASH`, `EQUAL` and `ALLOCATOR` from the other parameters passed to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless&colon; (1) the supplied `HASH` is invokable with a `KEY`, (2) the supplied `EQUAL` is invokable with two `KEY`s, and (3) the supplied allocator meets the requirements of a standard allocator&period;
| xref:bsl/unordered_map-05d.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameters `HASH` and `ALLOCATOR` from the other parameters supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied `HASH` is invokable with a `KEY`, and the supplied allocator meets the requirements of a standard allocator&period;
| xref:bsl/unordered_map-0e6.adoc[`unordered&lowbar;map&lt;KEY, VALUE, HASH, bsl::equal&lowbar;to&lt;KEY&gt;, ALLOCATOR&gt;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameters `HASH` and `ALLOCATOR` from the other parameters passed to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied hash is invokable with a `KEY` and the supplied allocator meets the requirements of a standard allocator&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;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameter `ALLOCATOR` from the other parameters supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator meets the requirements of a standard allocator&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;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the initializer&lowbar;list supplied to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator meets the requirements of a standard allocator&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;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameter `ALLOCATOR` from the other parameter passed to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator meets the requirements of a standard allocator&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;`] 
| Deduce the template parameters `KEY` and `VALUE` from the `value&lowbar;type` of the iterators supplied to the constructor of `unordered&lowbar;map`&period; Deduce the template parameter `ALLOCATOR` from the other parameter passed to the constructor of `unordered&lowbar;map`&period; This deduction guide does not participate unless the supplied allocator meets the requirements of a standard allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/operator_eq-0cb.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-0a4.adoc[`erase&lowbar;if`]
| Erase all the elements in the specified unordered&lowbar;map `m` that satisfy the specified predicate `predicate`&period; Return the number of elements erased&period;
| xref:bsl/operator_eq-024.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period; Two `unordered&lowbar;map` objects have the same value if they have the same number of key&hyphen;value pairs, and for each key&hyphen;value pair that is contained in `lhs` there is a key&hyphen;value pair contained in `rhs` having the same value, and vice versa&period; Note that this method requires that the (template parameter) types `KEY` and `VALUE` both be `equality&hyphen;comparable` (see &lcub;Requirements on `value&lowbar;type`&rcub;)&period;
| xref:bsl/swap-04c.adoc[`swap`]
| Exchange the value, hasher, key&hyphen;equality functor, and `max&lowbar;load&lowbar;factor` of the specified `a` object with those of the specified `b` object&semi; also exchange the allocator of `a` with that of `b` if the (template parameter) type `ALLOCATOR` has the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait, and do not modify either allocator otherwise&period; This function provides the no&hyphen;throw exception&hyphen;safety guarantee if and only if both the (template parameter) types `HASH` and `EQUAL` provide no&hyphen;throw swap operations&semi; if an exception is thrown, both objects are left in valid but unspecified states&period; This operation guarantees `O&lsqb;1&rsqb;` complexity&period; The behavior is undefined unless either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate&lowbar;on&lowbar;container&lowbar;swap` trait&period;
|===


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