Ordered associative container mapping unique keys to values.
Synopsis
Declared in <bslstl_map.h>
template<
class KEY,
class VALUE,
class COMPARATOR = std::less<KEY>,
class ALLOCATOR = allocator<pair<KEY const, VALUE>>>
class map;
Description
This class template implements a value‐semantic container type holding an ordered sequence of key‐value pairs having unique keys that provide a mapping from keys (of the template parameter type, KEY) to their associated values (of another template parameter type, VALUE).
This class: * supports a complete set of value‐semantic operations
-
except for BDEX serialization * is exception‐neutral * is alias‐safe * is
constthread‐safe For terminology see {`bsldoc_glossary`}.
Types
Name |
Description |
Adaptor that compares |
Type Aliases
Name |
Description |
Alias for the allocator type |
|
Constant bidirectional iterator over |
|
Alias for the const pointer type supplied by the allocator traits. |
|
Alias for a constant reference to a map element. |
|
Reverse iterator type for traversing the map in reverse order. |
|
Signed integer type measuring iterator distance. |
|
Bidirectional iterator over |
|
Alias for the key‐comparison functor type |
|
Alias for the key type |
|
Alias for the mapped value type |
|
Alias for the pointer type supplied by the allocator traits. |
|
Alias for a modifiable reference to a map element. |
|
Reverse iterator over |
|
Alias for the size type supplied by the allocator traits. |
|
Alias for the map element type |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Assignment operators |
|
|
|
|
|
Return a const iterator to the first element, or |
|
Return an iterator providing non‐modifiable access to the past‐the‐end element in the ordered sequence of |
|
Remove all entries from this map. Note that the map is empty after this call, but allocated memory may be retained for future use. |
|
Return whether this map contains an element equivalent to |
|
Return the number of elements equivalent to |
|
Return a const reverse iterator to the last element, or |
|
Return a const reverse iterator to prior‐to‐beginning. |
|
Emplace a newly constructed element into this map. |
|
Emplace a newly constructed element near |
|
Return |
|
|
|
Return the half‐open range of elements equivalent to |
|
|
|
|
|
Return (a copy of) the allocator used for memory allocation by this map. |
|
|
|
|
|
Insert elements from |
|
Return the key‐comparison functor used by this map. |
|
|
|
Return a theoretical upper bound on the size of this map. |
|
Subscript operators |
|
|
|
|
|
Return the number of elements in this map. |
|
Exchange the value and comparator with |
|
|
|
|
|
Return a functor that compares two |
Deduction Guides
Name |
Description |
Deduce |
|
Deduce |
|
Deduce |
|
Deduce |
|
Deduce |
|
Deduce |
|
Deduce |
|
Deduce |
Non-Member Functions
Name |
Description |
Erase every element of |
|
Perform a lexicographic three‐way comparison of |
|
Return |
|
Exchange the value and comparator of |
Created with MrDocs