[#bsl-hash_map]
= xref:bsl.adoc[bsl]::hash&lowbar;map
:relfileprefix: ../
:mrdocs:

Legacy STLPort hash container mapping unique keys to values&period;

== Synopsis

Declared in `&lt;bslstp&lowbar;hashmap&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class &lowbar;Key,
    class &lowbar;Tp,
    class &lowbar;HashFcn = BloombergLP::bslstp::HashSelector&lt;&lowbar;Key&gt;::Type,
    class &lowbar;EqualKey = bsl::ComparatorSelector&lt;&lowbar;Key&gt;::Type,
    class &lowbar;Alloc = xref:bsl/allocator-0df.adoc[bsl::allocator&lt;pair&lt;&lowbar;Key const, &lowbar;Tp&gt;&gt;]&gt;
class hash&lowbar;map;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/hash_map/_value_type.adoc[`&lowbar;value&lowbar;type`] 
| Internal synonym for the element `pair` type&period;
| xref:bsl/hash_map/allocator_type.adoc[`allocator&lowbar;type`] 
| Allocator type used by this map&period;
| xref:bsl/hash_map/const_iterator.adoc[`const&lowbar;iterator`] 
| Iterator providing non&hyphen;modifiable access to elements&period;
| xref:bsl/hash_map/const_pointer.adoc[`const&lowbar;pointer`] 
| Pointer to a non&hyphen;modifiable element&period;
| xref:bsl/hash_map/const_reference.adoc[`const&lowbar;reference`] 
| Reference to a non&hyphen;modifiable element&period;
| xref:bsl/hash_map/data_type.adoc[`data&lowbar;type`] 
| Mapped value type (synonym for `mapped&lowbar;type`)&period;
| xref:bsl/hash_map/difference_type.adoc[`difference&lowbar;type`] 
| Signed integral type used for iterator distances&period;
| xref:bsl/hash_map/hasher.adoc[`hasher`] 
| Hash functor type&period;
| xref:bsl/hash_map/iterator.adoc[`iterator`] 
| Iterator providing modifiable access to elements&period;
| xref:bsl/hash_map/key_equal.adoc[`key&lowbar;equal`] 
| Key&hyphen;equality functor type&period;
| xref:bsl/hash_map/key_type.adoc[`key&lowbar;type`] 
| Key type used by this container&period;
| xref:bsl/hash_map/mapped_type.adoc[`mapped&lowbar;type`] 
| Type of the mapped value associated with each key&period;
| xref:bsl/hash_map/pointer.adoc[`pointer`] 
| Pointer to a modifiable element&period;
| xref:bsl/hash_map/reference.adoc[`reference`] 
| Reference to a modifiable element&period;
| xref:bsl/hash_map/size_type.adoc[`size&lowbar;type`] 
| Unsigned integral type used for sizes&period;
| xref:bsl/hash_map/value_type.adoc[`value&lowbar;type`] 
| Element type stored in the map (`pair&lt;const key, mapped&gt;`)&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/hash_map/2constructor-0e5.adoc[`hash&lowbar;map`]         [.small]#[constructor]#
| Constructors
| xref:bsl/hash_map/begin-04.adoc[`begin`] 
| `begin` overloads
| xref:bsl/hash_map/bucket_count.adoc[`bucket&lowbar;count`] 
| Return the number of buckets in this container&period;
| xref:bsl/hash_map/clear.adoc[`clear`] 
| Remove all elements from this map&period;
| xref:bsl/hash_map/count.adoc[`count`] 
| Return the number of elements matching the specified key&period;
| xref:bsl/hash_map/elems_in_bucket.adoc[`elems&lowbar;in&lowbar;bucket`] 
| Return the number of elements in the specified bucket&period;
| xref:bsl/hash_map/empty.adoc[`empty`] 
| Return `true` if this map contains no elements&period;
| xref:bsl/hash_map/end-02.adoc[`end`] 
| `end` overloads
| xref:bsl/hash_map/equal_range-0b3b.adoc[`equal&lowbar;range`] 
| `equal&lowbar;range` overloads
| xref:bsl/hash_map/erase-0a.adoc[`erase`] 
| `erase` overloads
| xref:bsl/hash_map/find-0c.adoc[`find`] 
| `find` overloads
| xref:bsl/hash_map/get_allocator.adoc[`get&lowbar;allocator`] 
| Return the allocator used by this map&period;
| xref:bsl/hash_map/hash_funct.adoc[`hash&lowbar;funct`] 
| Return the hash functor used by this map&period;
| xref:bsl/hash_map/insert-0c.adoc[`insert`] 
| `insert` overloads
| xref:bsl/hash_map/insert_noresize.adoc[`insert&lowbar;noresize`] 
| Insert `&lowbar;&lowbar;obj` without resizing the bucket vector if the key is new&period;
| xref:bsl/hash_map/key_eq.adoc[`key&lowbar;eq`] 
| Return the key&hyphen;equality functor used by this map&period;
| xref:bsl/hash_map/max_bucket_count.adoc[`max&lowbar;bucket&lowbar;count`] 
| Return the maximum number of buckets this container can use&period;
| xref:bsl/hash_map/max_size.adoc[`max&lowbar;size`] 
| Return an upper bound on the number of elements this map can hold&period;
| xref:bsl/hash_map/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Return a reference to the mapped value for `&lowbar;&lowbar;key`, inserting a default&hyphen;constructed value if the key is absent&period;
| xref:bsl/hash_map/resize.adoc[`resize`] 
| Rebuild the bucket vector using a size suggested by the specified hint&period;
| xref:bsl/hash_map/size.adoc[`size`] 
| Return the number of elements in this map&period;
| xref:bsl/hash_map/swap.adoc[`swap`] 
| Exchange the contents of this map with those of the specified map&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/hash_map/_M_equal.adoc[`&lowbar;M&lowbar;equal`] 
| Return `true` if the specified maps contain the same elements&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/operator_not_eq-0f.adoc[`operator!&equals;`]
| Return `true` if the specified hash maps do not contain the same elements&period;
| xref:bsl/operator_eq-08d.adoc[`operator&equals;&equals;`]
| Return `true` if the specified hash maps contain the same elements&period;
| xref:bsl/swap-030.adoc[`swap`]
| Exchange the contents of the specified hash maps&period;
|===


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