[#BloombergLP-bslstl-HashTable-2constructor-0c9b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable.adoc[HashTable]::HashTable
:relfileprefix: ../../../
:mrdocs:

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
HashTable(
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;HashTable&gt;] original,
    ALLOCATOR const& basicAllocator);
----

== Description

Create a hash table having the same value (and `maxLoadFactor`) as the specified `original` object that uses the specified `basicAllocator` to supply memory&period; The contents of `original` are moved (in constant time) to the new hash&hyphen;table if `basicAllocator &equals;&equals; original&period;get&lowbar;allocator()`, and are move&hyphen;inserted (in linear time) using `basicAllocator` otherwise&period; `original` is left in a valid but unspecified state&period; Use a copy of `original&period;hasher()` and a copy of `original&period;comparator()` to organize elements in this hash&hyphen;table&period; This method requires that the `ValueType` defined by the (template parameter) type `KEY&lowbar;CONFIG` be `move&hyphen;insertable` into this hash&hyphen;table&period; Note that this hash&hyphen;table may have a different `numBuckets` than `original`, and a correspondingly different `loadFactor`, as long as `maxLoadFactor` is not exceeded&period; Also note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| hash table to move from
| *basicAllocator*
| allocator used to supply memory
|===


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