[#BloombergLP-bslstl-HashTable-06-2constructor-09] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable]::HashTable :relfileprefix: ../../../ :mrdocs: Create an empty hash‐table using the specified `hash` and `compare` functors to organize elements in the table, which will initially have at least the specified `initialNumBuckets` and a `maxLoadFactor` of the specified `initialMaxLoadFactor`. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, a default‐constructed object of the (template parameter) type `ALLOCATOR` is used. If the type `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory. If this constructor tries to allocate a number of buckets larger than can be represented by this hash‐table's `SizeType`, a `std::length_error` exception is thrown. The behavior is undefined unless `0 < initialMaxLoadFactor`. Note that more than `initialNumBuckets` buckets may be created in order to preserve the bucket allocation strategy of the hash‐table (but never fewer). Also note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the type `ALLOCATOR` is `bsl::allocator` (the default). == Synopsis Declared in `<bslstl_hashtable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- HashTable( HASHER const& hash, COMPARATOR const& compare, xref:BloombergLP/bslstl/HashTable-06/SizeType.adoc[SizeType] initialNumBuckets, float initialMaxLoadFactor, ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#