This class template implements a value‐semantic container type holding an unordered map of KEY‐VALUE pairs having unique keys that provides a mapping from keys of (template parameter) type KEY to their associated mapped values of (template parameter) type VALUE. 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_flathashmap.h>
template<
class KEY,
class VALUE,
class HASH = bslh::FibonacciBadHashWrapper<bsl::hash<KEY>>,
class EQUAL = bsl::equal_to<KEY>>
class FlatHashMap;
Type Aliases
Name |
Description |
Iterator over non‐modifiable elements. |
|
Pointer to a non‐modifiable value. |
|
Reference to a non‐modifiable value. |
|
Signed type used for iterator distances. |
|
Hash functor type. |
|
Iterator over modifiable elements. |
|
Key equality predicate type. |
|
Key type of this map. |
|
Mapped value type of this map. |
|
Pointer to a modifiable value. |
|
Reference to a modifiable value. |
|
Unsigned type used for sizes and capacities. |
|
Key/value pair type stored by this map. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object and each of its elements. |
Assignment operators |
|
Return the allocator used by this flat hash map to supply memory. |
|
|
|
|
|
Return the number of elements this map could hold if the load factor were 1. |
|
Return a |
|
Return a |
|
Remove all elements from this map. Note that this map will be empty after calling this method, but allocated memory may be retained for future use. See the |
|
|
|
|
|
Insert into this map a newly‐created |
|
Insert into this map a newly‐created |
|
Return |
|
|
|
|
|
|
|
|
|
Return (a copy of) the unary hash functor used by this map 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 map. Note that if an insert operation would cause the load factor to exceed |
|
Subscript operators |
|
Format this object to the specified output |
|
Change the capacity of this map to at least the specified |
|
Change the capacity of this map to at least a capacity that can accommodate the specified |
|
Remove all elements from this map and release all memory from this map, returning the map to the default constructed state. |
|
Return the number of elements in this map. |
|
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 maps. |
|
Return whether the maps differ in key/value contents. |
|
Return whether the maps have the same key/value contents. |
Non-Member Functions
Name |
Description |
Return |
|
Return |
|
Exchange the value, the hasher, and the key‐equality functor of the specified |
Created with MrDocs