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

Unordered set of unique `KEY` values with open&hyphen;addressing storage&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class KEY,
    class HASH = xref:BloombergLP/bslh/FibonacciBadHashWrapper.adoc[bslh::FibonacciBadHashWrapper&lt;bsl::hash&lt;KEY&gt;&gt;],
    class EQUAL = xref:bsl/equal_to-0d.adoc[bsl::equal&lowbar;to&lt;KEY&gt;]&gt;
class FlatHashSet;
----

== Description

This class template implements a value&hyphen;semantic container type holding an unordered set of unique values of (template parameter) type `KEY`&period; The (template parameter) type `HASH` is a functor providing the hash value for `KEY`&period; The (template parameter) type `EQUAL` is a functor providing the equality function for two `KEY` values&period; See &lcub;Requirements on `KEY`, `HASH`, and `EQUAL`&rcub; for more information&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/FlatHashSet/const_iterator.adoc[`const&lowbar;iterator`] 
| Const iterator over elements&period;
| xref:BloombergLP/bdlc/FlatHashSet/const_pointer.adoc[`const&lowbar;pointer`] 
| Pointer to a non&hyphen;modifiable value&period;
| xref:BloombergLP/bdlc/FlatHashSet/const_reference.adoc[`const&lowbar;reference`] 
| Reference to a non&hyphen;modifiable value&period;
| xref:BloombergLP/bdlc/FlatHashSet/difference_type.adoc[`difference&lowbar;type`] 
| Signed type used for iterator distances&period;
| xref:BloombergLP/bdlc/FlatHashSet/hasher.adoc[`hasher`] 
| Hash functor type&period;
| xref:BloombergLP/bdlc/FlatHashSet/iterator.adoc[`iterator`] 
| Iterator over elements (const, since set values are immutable)&period;
| xref:BloombergLP/bdlc/FlatHashSet/key_compare.adoc[`key&lowbar;compare`] 
| Key equality predicate type&period;
| xref:BloombergLP/bdlc/FlatHashSet/key_type.adoc[`key&lowbar;type`] 
| Key type of this set (also the element type)&period;
| xref:BloombergLP/bdlc/FlatHashSet/pointer.adoc[`pointer`] 
| Pointer to a modifiable value&period;
| xref:BloombergLP/bdlc/FlatHashSet/reference.adoc[`reference`] 
| Reference to a modifiable value&period;
| xref:BloombergLP/bdlc/FlatHashSet/size_type.adoc[`size&lowbar;type`] 
| Unsigned type used for sizes and capacities&period;
| xref:BloombergLP/bdlc/FlatHashSet/value_compare.adoc[`value&lowbar;compare`] 
| Value equality predicate type (same as `key&lowbar;compare`)&period;
| xref:BloombergLP/bdlc/FlatHashSet/value_type.adoc[`value&lowbar;type`] 
| Element type stored by this set&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/FlatHashSet/2constructor-0a.adoc[`FlatHashSet`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlc/FlatHashSet/2destructor.adoc[`&#126;FlatHashSet`] [.small]#[destructor]#
| Destroy this object and each of its elements&period;
| xref:BloombergLP/bdlc/FlatHashSet/operator_assign-003.adoc[`operator&equals;`] 
| Assignment operators
| xref:BloombergLP/bdlc/FlatHashSet/allocator.adoc[`allocator`] 
| Return the allocator used by this flat hash set to supply memory&period;
| xref:BloombergLP/bdlc/FlatHashSet/begin.adoc[`begin`] 
| Return a `const&lowbar;iterator` to the first element in the sequence of elements maintained by this set, or the `end` iterator if this set is empty&period;
| xref:BloombergLP/bdlc/FlatHashSet/capacity.adoc[`capacity`] 
| Return the number of elements this set could hold if the load factor were 1&period;
| xref:BloombergLP/bdlc/FlatHashSet/cbegin.adoc[`cbegin`] 
| Return a `const&lowbar;iterator` to the first element in the sequence of elements maintained by this set, or the `end` iterator if this set is empty&period;
| xref:BloombergLP/bdlc/FlatHashSet/cend.adoc[`cend`] 
| Return a `const&lowbar;iterator` to the past&hyphen;the&hyphen;end element in the sequence of `KEY` elements maintained by this set&period;
| xref:BloombergLP/bdlc/FlatHashSet/clear.adoc[`clear`] 
| Remove all elements from this set&period;
| xref:BloombergLP/bdlc/FlatHashSet/contains-03.adoc[`contains`] 
| `contains` overloads
| xref:BloombergLP/bdlc/FlatHashSet/count-00.adoc[`count`] 
| `count` overloads
| xref:BloombergLP/bdlc/FlatHashSet/emplace.adoc[`emplace`] 
| Emplace a newly constructed element into this set&period;
| xref:BloombergLP/bdlc/FlatHashSet/emplace_hint.adoc[`emplace&lowbar;hint`] 
| Emplace a newly constructed element, using an insertion hint&period;
| xref:BloombergLP/bdlc/FlatHashSet/empty.adoc[`empty`] 
| Return `true` if this set contains no elements, and `false` otherwise&period;
| xref:BloombergLP/bdlc/FlatHashSet/end.adoc[`end`] 
| Return a `const&lowbar;iterator` to the past&hyphen;the&hyphen;end element in the sequence of `KEY` elements maintained by this set&period;
| xref:BloombergLP/bdlc/FlatHashSet/equal_range-0f.adoc[`equal&lowbar;range`] 
| `equal&lowbar;range` overloads
| xref:BloombergLP/bdlc/FlatHashSet/erase-05.adoc[`erase`] 
| `erase` overloads
| xref:BloombergLP/bdlc/FlatHashSet/find-08.adoc[`find`] 
| `find` overloads
| xref:BloombergLP/bdlc/FlatHashSet/hash_function.adoc[`hash&lowbar;function`] 
| Return (a copy of) the unary hash functor used by this set to generate a hash value (of type `bsl&colon;&colon;size&lowbar;t`) for a `KEY` object&period;
| xref:BloombergLP/bdlc/FlatHashSet/insert-0c.adoc[`insert`] 
| `insert` overloads
| xref:BloombergLP/bdlc/FlatHashSet/key_eq.adoc[`key&lowbar;eq`] 
| Return (a copy of) the binary key&hyphen;equality functor that returns `true` if the value of two `KEY` objects are equivalent, and `false` otherwise&period;
| xref:BloombergLP/bdlc/FlatHashSet/load_factor.adoc[`load&lowbar;factor`] 
| Return the current ratio between the number of elements in this container and its capacity&period;
| xref:BloombergLP/bdlc/FlatHashSet/max_load_factor.adoc[`max&lowbar;load&lowbar;factor`] 
| Return the maximum load factor allowed for this set&period;
| xref:BloombergLP/bdlc/FlatHashSet/print.adoc[`print`] 
| Format this object to the specified output stream&period;
| xref:BloombergLP/bdlc/FlatHashSet/rehash.adoc[`rehash`] 
| Rehash this set to at least the specified minimum capacity&period;
| xref:BloombergLP/bdlc/FlatHashSet/reserve.adoc[`reserve`] 
| Reserve capacity for at least the specified number of entries&period;
| xref:BloombergLP/bdlc/FlatHashSet/reset.adoc[`reset`] 
| Remove all elements from this set and release all memory from this set, returning the set to the default constructed state&period;
| xref:BloombergLP/bdlc/FlatHashSet/size.adoc[`size`] 
| Return the number of elements in this set&period;
| xref:BloombergLP/bdlc/FlatHashSet/swap.adoc[`swap`] 
| Exchange the value of this set with that of the specified `other`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlc/swap-060.adoc[BloombergLP::bdlc::swap]`
| Exchange the contents of the two sets&period;
| `xref:BloombergLP/bdlc/operator_not_eq-0473.adoc[BloombergLP::bdlc::operator!&equals;]`
| Return whether the sets differ in contents&period;
| `xref:BloombergLP/bdlc/operator_eq-096.adoc[BloombergLP::bdlc::operator&equals;&equals;]`
| Return whether the sets have the same contents&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlc/operator_not_eq-01f.adoc[`operator!&equals;`]
| Return whether two sets do not have the same value&period;
| xref:BloombergLP/bdlc/operator_eq-042.adoc[`operator&equals;&equals;`]
| Return whether two sets have the same value&period;
| xref:BloombergLP/bdlc/swap-0b8.adoc[`swap`]
| Exchange the value, hasher, and key&hyphen;equality functor of two sets&period;
|===


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