This class template implements a value‐semantic container type holding an unordered set of unique values of (template parameter) type KEY. The (template parameter) type HASH is a functor providing the hash value for KEY. The (template parameter) type EQUAL is a functor providing the equality function for two KEY values. See {Requirements on KEY, HASH, and EQUAL} for more information.
Synopsis
Declared in <bdlc_flathashset.h>
template<
class KEY,
class HASH = bslh::FibonacciBadHashWrapper<bsl::hash<KEY>>,
class EQUAL = bsl::equal_to<KEY>>
class FlatHashSet;
Type Aliases
Name |
Description |
Const iterator over elements. |
|
Pointer to a non‐modifiable value. |
|
Reference to a non‐modifiable value. |
|
Signed type used for iterator distances. |
|
Hash functor type. |
|
Iterator over elements (const, since set values are immutable). |
|
Key equality predicate type. |
|
Key type of this set (also the element type). |
|
Pointer to a modifiable value. |
|
Reference to a modifiable value. |
|
Unsigned type used for sizes and capacities. |
|
Value equality predicate type (same as |
|
Element type stored by this set. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object and each of its elements. |
Assignment operators |
|
Return the allocator used by this flat hash set to supply memory. |
|
Return a |
|
Return the number of elements this set could hold if the load factor were 1. |
|
Return a |
|
Return a |
|
Remove all elements from this set. Note that this set will be empty after calling this method, but allocated memory may be retained for future use. See the |
|
|
|
|
|
Insert into this set a newly created |
|
Insert into this set a newly created |
|
Return |
|
Return a |
|
|
|
|
|
Return a |
|
Return (a copy of) the unary hash functor used by this set to generate a hash value (of type |
|
|
|
Return (a copy of) the binary key‐equality functor that returns |
|
Return the current ratio between the number of elements in this container and its capacity. |
|
Return the maximum load factor allowed for this set. Note that if an insert operation would cause the load factor to exceed |
|
Format this object to the specified output |
|
Change the capacity of this set to at least the specified |
|
Change the capacity of this set to at least a capacity that can accommodate the specified |
|
Remove all elements from this set and release all memory from this set, returning the set to the default constructed state. |
|
Return the number of elements in this set. |
|
Exchange the value of this object as well as its hasher and equality functors with those of the specified |
Friends
Name |
Description |
Exchange the contents of the two sets. |
|
Return whether the sets differ in contents. |
|
Return whether the sets have the same contents. |
Non-Member Functions
Name |
Description |
Return |
|
Return |
|
Exchange the value, the hasher, and the key‐equality functor of the specified |
Created with MrDocs