[#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 `<bdlc_flathashtable.h>` 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. Use a copy of `original.hash_function()` to generate hash values for the keys of the entries contained in this table. Use a copy of `original.key_eq()` to verify that two keys are equal. The allocator associated with `original` is propagated for use in the newly‐created table. `original` is left in a (valid) unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:BloombergLP/bdlc/FlatHashTable/2constructor-0d.adoc[FlatHashTable](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<FlatHashTable>] original); ---- [.small]#xref:BloombergLP/bdlc/FlatHashTable/2constructor-0d.adoc[_» more..._]# Create a table having the same value, hasher, and key‐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. Use a copy of `original.hash_function()` to generate hash values for the entries contained in this table. Use a copy of `original.key_eq()` to verify that the keys of two entries are equal. This method requires that the (template parameter) type `ENTRY` be `move‐insertable` into this `FlatHashTable`. If `basicAllocator` is 0, the currently installed default allocator is used. 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; otherwise `original` is unchanged (and an exception may be thrown). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashTable/2constructor-07b.adoc[FlatHashTable]( xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<FlatHashTable>] original, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlc/FlatHashTable/2constructor-07b.adoc[_» more..._]# Create a table having the same value, hasher, and key‐equality comparator as the specified `original`. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. [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..._]# 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. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. If `0 == capacity`, no memory is allocated and the object is defined to be in the "zero‐capacity" state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlc/FlatHashTable/2constructor-07d.adoc[FlatHashTable]( std::size_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..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#