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

Constructors

== Synopses

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

Create an empty hash map&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/hash_map/2constructor-070.adoc[hash&lowbar;map]();
----

[.small]#xref:bsl/hash_map/2constructor-070.adoc[_» more&period;&period;&period;_]#

Create an empty hash map with at least the specified `&lowbar;&lowbar;n` buckets&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/hash_map/2constructor-06a.adoc[hash&lowbar;map](xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n);
----

[.small]#xref:bsl/hash_map/2constructor-06a.adoc[_» more&period;&period;&period;_]#

Create an empty hash map that uses allocator `&lowbar;&lowbar;a`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/hash_map/2constructor-031.adoc[hash&lowbar;map](xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-031.adoc[_» more&period;&period;&period;_]#

Create a hash map with the specified bucket count and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/hash_map/2constructor-094.adoc[hash&lowbar;map](
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-094.adoc[_» more&period;&period;&period;_]#

Create a hash map with the specified bucket count and hasher&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/hash_map/2constructor-090.adoc[hash&lowbar;map](
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/hasher.adoc[hasher] const& &lowbar;&lowbar;hf);
----

[.small]#xref:bsl/hash_map/2constructor-090.adoc[_» more&period;&period;&period;_]#

Copy&hyphen;construct a hash map using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/hash_map/2constructor-08.adoc[hash&lowbar;map](
    xref:bsl/hash_map.adoc[&lowbar;Self] const& &lowbar;&lowbar;x,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-08.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-02.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l);
----

[.small]#xref:bsl/hash_map/2constructor-02.adoc[_» more&period;&period;&period;_]#

Create a hash map with the specified bucket count, hasher, and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/hash_map/2constructor-0ec.adoc[hash&lowbar;map](
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/hasher.adoc[hasher] const& &lowbar;&lowbar;hf,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-0ec.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-05.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l,
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n);
----

[.small]#xref:bsl/hash_map/2constructor-05.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-096.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-096.adoc[_» more&period;&period;&period;_]#

Create a hash map with the specified hasher, equality predicate, and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/hash_map/2constructor-0c.adoc[hash&lowbar;map](
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/hasher.adoc[hasher] const& &lowbar;&lowbar;hf,
    xref:bsl/hash_map/key_equal.adoc[key&lowbar;equal] const& &lowbar;&lowbar;eql,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a = allocator&lowbar;type());
----

[.small]#xref:bsl/hash_map/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-06d.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l,
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-06d.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-0a.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l,
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/hasher.adoc[hasher] const& &lowbar;&lowbar;hf);
----

[.small]#xref:bsl/hash_map/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-039.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l,
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/hasher.adoc[hasher] const& &lowbar;&lowbar;hf,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a);
----

[.small]#xref:bsl/hash_map/2constructor-039.adoc[_» more&period;&period;&period;_]#

Create a hash map from the specified iterator range&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class &lowbar;InputIterator&gt;
xref:bsl/hash_map/2constructor-07d.adoc[hash&lowbar;map](
    &lowbar;InputIterator &lowbar;&lowbar;f,
    &lowbar;InputIterator &lowbar;&lowbar;l,
    xref:bsl/hash_map/size_type.adoc[size&lowbar;type] &lowbar;&lowbar;n,
    xref:bsl/hash_map/hasher.adoc[hasher] const& &lowbar;&lowbar;hf,
    xref:bsl/hash_map/key_equal.adoc[key&lowbar;equal] const& &lowbar;&lowbar;eql,
    xref:bsl/hash_map/allocator_type.adoc[allocator&lowbar;type] const& &lowbar;&lowbar;a = allocator&lowbar;type());
----

[.small]#xref:bsl/hash_map/2constructor-07d.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *&lowbar;&lowbar;n*
| minimum number of buckets to create
| *&lowbar;&lowbar;a*
| allocator used to supply memory
| *&lowbar;&lowbar;hf*
| hash functor
| *&lowbar;&lowbar;x*
| hash map whose value is copied
| *&lowbar;&lowbar;f*
| beginning of the input range
| *&lowbar;&lowbar;l*
| end of the input range
| *&lowbar;&lowbar;eql*
| key&hyphen;equality predicate
|===


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