[#BloombergLP-bdlc-FlatHashTable-2constructor-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashTable.adoc[FlatHashTable]::FlatHashTable
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create an table having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new table&period; Use a copy of `original&period;hash&lowbar;function()` to generate hash values for the keys of the entries contained in this table&period; Use a copy of `original&period;key&lowbar;eq()` to verify that two keys are equal&period; The allocator associated with `original` is propagated for use in the newly&hyphen;created table&period; `original` is left in a (valid) unspecified state&period;


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

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

Create a table having the same value, hasher, and key&hyphen;equality comparator as the specified `original` object by moving the contents of `original` to the new table, and using the specified `basicAllocator` to supply memory&period; Use a copy of `original&period;hash&lowbar;function()` to generate hash values for the entries contained in this table&period; Use a copy of `original&period;key&lowbar;eq()` to verify that the keys of two entries are equal&period; This method requires that the (template parameter) type `ENTRY` be `move&hyphen;insertable` into this `FlatHashTable`&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; If `original` and the newly created object have the same allocator then the value of `original` becomes unspecified but valid, and no exceptions will be thrown&semi; otherwise `original` is unchanged (and an exception may be thrown)&period;


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

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

Create a table having the same value, hasher, and key&hyphen;equality comparator as the specified `original`&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period;


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

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

Create an empty table having at least the specified `capacity`, that will use the specified `hash` to generate hash values for the keys of the entries contained in this table, and the specified `equal` to verify that the keys of the two entries are the same&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period; If `0 &equals;&equals; capacity`, no memory is allocated and the object is defined to be in the &quot;zero&hyphen;capacity&quot; state&period;


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

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


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