[#BloombergLP-bdlc-FlatHashMap-2constructor-056]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::FlatHashMap
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bdlc&lowbar;flathashmap&period;h&gt;`

Create an empty `FlatHashMap` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-07.adoc[FlatHashMap]();
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-07.adoc[_» more&period;&period;&period;_]#

Create an empty map with at least the specified `capacity`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlc/FlatHashMap/2constructor-01.adoc[FlatHashMap](std::size&lowbar;t capacity);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-01.adoc[_» more&period;&period;&period;_]#

Create a map by moving from the specified `original` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fc.adoc[FlatHashMap](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;FlatHashMap&gt;] original);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fc.adoc[_» more&period;&period;&period;_]#

Create an empty map using the specified `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e1.adoc[FlatHashMap](xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e1.adoc[_» more&period;&period;&period;_]#

Create an empty map with at least the specified `capacity`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0a4.adoc[FlatHashMap](
    std::size&lowbar;t capacity,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0a4.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-03.adoc[FlatHashMap](
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;FlatHashMap&gt;] original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-03.adoc[_» more&period;&period;&period;_]#

Create a map populated from the specified `values` initializer list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fa.adoc[FlatHashMap](
    bsl::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0fa.adoc[_» more&period;&period;&period;_]#

Create a map with the same value as the specified `original` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-06a.adoc[FlatHashMap](
    xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap] const& original,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Create an empty map with at least the specified `capacity` and `hash`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-051.adoc[FlatHashMap](
    std::size&lowbar;t capacity,
    HASH const& hash,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-051.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, also requesting at least the specified `capacity`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e8.adoc[FlatHashMap](
    bsl::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    std::size&lowbar;t capacity,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0e8.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdlc/FlatHashMap/2constructor-06c.adoc[FlatHashMap](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-06c.adoc[_» more&period;&period;&period;_]#

Create an empty map with the specified `capacity`, `hash`, and `equal`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0c.adoc[FlatHashMap](
    std::size&lowbar;t capacity,
    HASH const& hash,
    EQUAL const& equal,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

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

Same as the preceding overload, also using the specified `hash`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-00.adoc[FlatHashMap](
    bsl::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    std::size&lowbar;t capacity,
    HASH const& hash,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-00.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, also requesting at least the specified `capacity`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d4.adoc[FlatHashMap](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    std::size&lowbar;t capacity,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d4.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, also using the specified `equal`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0af.adoc[FlatHashMap](
    bsl::initializer&lowbar;list&lt;value&lowbar;type&gt; values,
    std::size&lowbar;t capacity,
    HASH const& hash,
    EQUAL const& equal,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0af.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, also using the specified `hash`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d7.adoc[FlatHashMap](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    std::size&lowbar;t capacity,
    HASH const& hash,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-0d7.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, also using the specified `equal`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdlc/FlatHashMap/2constructor-08.adoc[FlatHashMap](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    std::size&lowbar;t capacity,
    HASH const& hash,
    EQUAL const& equal,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator = 0);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/2constructor-08.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *capacity*
| minimum initial capacity of the underlying array
| *original*
| map to move from
| *basicAllocator*
| allocator used to supply memory
| *values*
| initializer list of key&sol;value pairs to insert
| *hash*
| hash functor used for keys
| *first*
| beginning of the input range
| *last*
| end of the input range (exclusive)
| *equal*
| key&hyphen;equality predicate
|===


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