BloombergLP::bdlc::FlatHashTable::FlatHashTable

Create an empty table with at least the specified capacity.

Synopsis

Declared in <bdlc_flathashtable.h>

FlatHashTable(
    std::size_t capacity,
    HASH const& hash,
    EQUAL const& equal,
    bslma::Allocator* basicAllocator = 0);

Description

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.

Parameters

NameDescription
capacityminimum capacity for the new table
hashhash functor used for keys
equalkey-equality predicate
basicAllocatorallocator used to supply memory