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

Constructors

== Synopses

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

Create an empty unordered map&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-0c.adoc[unordered&lowbar;map]();
----

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

Create an unordered map as a copy of `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-03.adoc[unordered&lowbar;map](xref:bsl/unordered_map-02b.adoc[unordered&lowbar;map] const& original);
----

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

Create an unordered map by moving from `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-05.adoc[unordered&lowbar;map](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;unordered&lowbar;map&gt;] original);
----

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

Create an empty unordered map using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/unordered_map-02b/2constructor-04.adoc[unordered&lowbar;map](ALLOCATOR const& basicAllocator);
----

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

Create an empty unordered map with bucket count and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-06.adoc[unordered&lowbar;map](
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map by moving from `original` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-0ee.adoc[unordered&lowbar;map](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;unordered&lowbar;map&gt;] original,
    ALLOCATOR const& basicAllocator);
----

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

Create a copy of `original` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-093.adoc[unordered&lowbar;map](
    xref:bsl/unordered_map-02b.adoc[unordered&lowbar;map] const& original,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `values` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
requires bsl&colon;&colon;IsStdAllocator&lowbar;v&lt;ALLOCATOR&gt;
xref:bsl/unordered_map-02b/2constructor-0a.adoc[unordered&lowbar;map](
    std::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    ALLOCATOR const& basicAllocator);
----

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

Create an empty unordered map with hash and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/2constructor-0fd.adoc[unordered&lowbar;map](
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `values` with bucket count and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
requires bsl&colon;&colon;IsStdAllocator&lowbar;v&lt;ALLOCATOR&gt;
xref:bsl/unordered_map-02b/2constructor-0b.adoc[unordered&lowbar;map](
    std::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `&lsqb;first, last)&rsqb;` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_map-02b/2constructor-095.adoc[unordered&lowbar;map](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `range` using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_map-02b/2constructor-0fb.adoc[unordered&lowbar;map](
    std::from&lowbar;range&lowbar;t tag,
    RANGE&& range,
    ALLOCATOR const& basicAllocator);
----

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

Create an empty unordered map&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/unordered_map-02b/2constructor-07b.adoc[unordered&lowbar;map](
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

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

Create an unordered map from `values` with hash and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
requires std&colon;&colon;is&lowbar;invocable&lowbar;v&lt;HASH, const KEY &amp;&gt; &amp;&amp; bsl&colon;&colon;IsStdAllocator&lowbar;v&lt;ALLOCATOR&gt;
xref:bsl/unordered_map-02b/2constructor-028.adoc[unordered&lowbar;map](
    std::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `&lsqb;first, last)&rsqb;` with bucket count&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_map-02b/2constructor-00.adoc[unordered&lowbar;map](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `range` with bucket count and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_map-02b/2constructor-085.adoc[unordered&lowbar;map](
    std::from&lowbar;range&lowbar;t tag,
    RANGE&& range,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from the specified `values` initializer list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
requires std&colon;&colon;is&lowbar;invocable&lowbar;v&lt;HASH, const KEY &amp;&gt; &amp;&amp; std&colon;&colon;is&lowbar;invocable&lowbar;v&lt;EQUAL, const KEY &amp;, const KEY &amp;&gt; &amp;&amp; bsl&colon;&colon;IsStdAllocator&lowbar;v&lt;ALLOCATOR&gt;
xref:bsl/unordered_map-02b/2constructor-02a.adoc[unordered&lowbar;map](
    std::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

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

Create an unordered map from `&lsqb;first, last)&rsqb;` with hash and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_map-02b/2constructor-0ef.adoc[unordered&lowbar;map](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from `range` with hash and allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_map-02b/2constructor-08d.adoc[unordered&lowbar;map](
    std::from&lowbar;range&lowbar;t tag,
    RANGE&& range,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

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

Create an unordered map from the iterator range `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_map-02b/2constructor-09b.adoc[unordered&lowbar;map](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

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

Create an unordered map from the specified `range`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_map-02b/2constructor-076.adoc[unordered&lowbar;map](
    std::from&lowbar;range&lowbar;t tag,
    RANGE&& range,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| unordered map to copy or move from
| *basicAllocator*
| allocator used to supply memory
| *initialNumBuckets*
| initial number of buckets
| *values*
| initializer list of values to insert
| *hashFunction*
| hash functor
| *first*
| start of the range
| *last*
| end of the range (one past last)
| *tag*
| disambiguation tag for from&hyphen;range construction
| *range*
| input range of values to insert
| *keyEqual*
| key&hyphen;equality functor
|===


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