[#BloombergLP-bdlc-FlatHashTable]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::FlatHashTable
:relfileprefix: ../../
:mrdocs:

This class template provides a flat hash table implementation useful for implementing a flat hash set and flat hash map&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class ENTRY,
    class ENTRY&lowbar;UTIL,
    class HASH,
    class EQUAL&gt;
class FlatHashTable;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/FlatHashTable/const_iterator.adoc[`const&lowbar;iterator`] 
| Iterator providing non&hyphen;modifiable access to entries&period;
| xref:BloombergLP/bdlc/FlatHashTable/entry_type.adoc[`entry&lowbar;type`] 
| Entry type stored by this table&period;
| xref:BloombergLP/bdlc/FlatHashTable/entry_util_type.adoc[`entry&lowbar;util&lowbar;type`] 
| Utility type for constructing entries and extracting keys&period;
| xref:BloombergLP/bdlc/FlatHashTable/hash_type.adoc[`hash&lowbar;type`] 
| Hash functor type&period;
| xref:BloombergLP/bdlc/FlatHashTable/iterator.adoc[`iterator`] 
| Iterator providing modifiable access to entries&period;
| xref:BloombergLP/bdlc/FlatHashTable/key_equal_type.adoc[`key&lowbar;equal&lowbar;type`] 
| Key equality predicate type&period;
| xref:BloombergLP/bdlc/FlatHashTable/key_type.adoc[`key&lowbar;type`] 
| Key type used by this table&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/FlatHashTable/2constructor-0f.adoc[`FlatHashTable`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlc/FlatHashTable/2destructor.adoc[`&#126;FlatHashTable`] [.small]#[destructor]#
| Destroy this object and each of its entries&period;
| xref:BloombergLP/bdlc/FlatHashTable/operator_assign-00.adoc[`operator&equals;`] 
| Assignment operators
| xref:BloombergLP/bdlc/FlatHashTable/allocator.adoc[`allocator`] 
| Return the allocator used by this hash table to supply memory&period;
| xref:BloombergLP/bdlc/FlatHashTable/begin-05.adoc[`begin`] 
| Return an iterator representing the beginning of the sequence of entries held by this container&period;
| xref:BloombergLP/bdlc/FlatHashTable/capacity.adoc[`capacity`] 
| Return the number of elements this table could hold if the load factor were 1&period;
| xref:BloombergLP/bdlc/FlatHashTable/cbegin.adoc[`cbegin`] 
| Return an iterator representing the beginning of the sequence of entries held by this container&period;
| xref:BloombergLP/bdlc/FlatHashTable/cend.adoc[`cend`] 
| Return an iterator representing one past the end of the sequence of entries held by this container&period;
| xref:BloombergLP/bdlc/FlatHashTable/clear.adoc[`clear`] 
| Remove all entries from this table&period;
| xref:BloombergLP/bdlc/FlatHashTable/contains.adoc[`contains`] 
| Return `true` if this table contains an entry having the specified `key`, and `false` otherwise&period;
| xref:BloombergLP/bdlc/FlatHashTable/controls.adoc[`controls`] 
| Return the address of the underlying control array, or 0&period;
| xref:BloombergLP/bdlc/FlatHashTable/count.adoc[`count`] 
| Return the number of objects in this table having the specified `key`&period;
| xref:BloombergLP/bdlc/FlatHashTable/emplace.adoc[`emplace`] 
| Emplace an `ENTRY` constructed from `args` into this table&period;
| xref:BloombergLP/bdlc/FlatHashTable/empty.adoc[`empty`] 
| Return `true` if this table contains no entries, and `false` otherwise&period;
| xref:BloombergLP/bdlc/FlatHashTable/end-07.adoc[`end`] 
| Return an iterator representing one past the end of the sequence of entries held by this container&period;
| xref:BloombergLP/bdlc/FlatHashTable/entries.adoc[`entries`] 
| Return the address of the underlying entries array, or 0&period;
| xref:BloombergLP/bdlc/FlatHashTable/equal_range-07.adoc[`equal&lowbar;range`] 
| `equal&lowbar;range` overloads
| xref:BloombergLP/bdlc/FlatHashTable/erase-03.adoc[`erase`] 
| `erase` overloads
| xref:BloombergLP/bdlc/FlatHashTable/find-082.adoc[`find`] 
| `find` overloads
| xref:BloombergLP/bdlc/FlatHashTable/hash_function.adoc[`hash&lowbar;function`] 
| Return (a copy of) the unary hash functor used by this flat hash table to generate a hash value (of type `bsl&colon;&colon;size&lowbar;t) for a `KEY&apos; object&period;
| xref:BloombergLP/bdlc/FlatHashTable/insert-0e.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bdlc/FlatHashTable/insertTransparent.adoc[`insertTransparent`] 
| Insert an entry for `key` if no equivalent key is already present&period;
| xref:BloombergLP/bdlc/FlatHashTable/key_eq.adoc[`key&lowbar;eq`] 
| Return (a copy of) the binary key&hyphen;equality functor used by this flat hash table that returns `true` if two `KEY` objects are equal, and `false` otherwise&period;
| xref:BloombergLP/bdlc/FlatHashTable/load_factor.adoc[`load&lowbar;factor`] 
| Return the current ratio between the number of elements in this table and its capacity&period;
| xref:BloombergLP/bdlc/FlatHashTable/max_load_factor.adoc[`max&lowbar;load&lowbar;factor`] 
| Return the maximum load factor allowed for this table&period;
| xref:BloombergLP/bdlc/FlatHashTable/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Return a reference to the entry for `key`, inserting one if needed&period;
| xref:BloombergLP/bdlc/FlatHashTable/rehash.adoc[`rehash`] 
| Change the capacity to at least `minimumCapacity` and rehash&period;
| xref:BloombergLP/bdlc/FlatHashTable/reserve.adoc[`reserve`] 
| Reserve capacity for at least the specified `numEntries`&period;
| xref:BloombergLP/bdlc/FlatHashTable/reset.adoc[`reset`] 
| Remove all entries from this table and release all memory from this table, returning the table to the zero&hyphen;capacity state&period;
| xref:BloombergLP/bdlc/FlatHashTable/size.adoc[`size`] 
| Return the number of entries in this table&period;
| xref:BloombergLP/bdlc/FlatHashTable/swap.adoc[`swap`] 
| Efficiently exchange the value of this table with `other`&period;
| xref:BloombergLP/bdlc/FlatHashTable/try_emplace-0b.adoc[`try&lowbar;emplace`] 
| Insert a newly constructed entry for `key` unless an equivalent key exists&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/FlatHashTable/k_HASHLET_MASK.adoc[`k&lowbar;HASHLET&lowbar;MASK`] 
| Mask used to extract the seven&hyphen;bit hashlet from a hash value&period;
| xref:BloombergLP/bdlc/FlatHashTable/k_MAX_LOAD_FACTOR_DENOMINATOR.adoc[`k&lowbar;MAX&lowbar;LOAD&lowbar;FACTOR&lowbar;DENOMINATOR`] 
| Denominator of the fraction that specifies the maximum load factor&period;
| xref:BloombergLP/bdlc/FlatHashTable/k_MAX_LOAD_FACTOR_NUMERATOR.adoc[`k&lowbar;MAX&lowbar;LOAD&lowbar;FACTOR&lowbar;NUMERATOR`] 
| Numerator of the fraction that specifies the maximum load factor&period;
| xref:BloombergLP/bdlc/FlatHashTable/k_MIN_CAPACITY.adoc[`k&lowbar;MIN&lowbar;CAPACITY`] 
| Minimum non&hyphen;zero capacity of a table&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/operator_not_eq-0be.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise&period;
| xref:BloombergLP/bdlc/operator_eq-0d5.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise&period;
| xref:BloombergLP/bdlc/swap-0b6.adoc[`swap`]
| Exchange the values of the specified `a` and `b` objects&period;
|===


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