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).
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: * 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 |
This nested class defines a mechanism for comparing two objects of |
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 an iterator providing non‐modifiable access to the first |
|
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 |
|
|
|
Return a reverse iterator providing non‐modifiable access to the last |
|
Return a reverse iterator providing non‐modifiable access to the prior‐to‐the‐beginning element in the ordered sequence of |
|
Insert into this map a newly‐created |
|
Insert into this map a newly‐created |
|
Return |
|
|
|
|
|
|
|
|
|
Return (a copy of) the allocator used for memory allocation by this map. |
|
|
|
|
|
Insert into this map the value of each |
|
Return the key‐comparison functor (or function pointer) used by this map; if a comparator was supplied at construction, return its value; otherwise, return a default constructed |
|
|
|
Return a theoretical upper bound on the largest number of elements that this map could possibly hold. Note that there is no guarantee that the map can successfully grow to the returned size, or even close to that size without running out of resources. |
|
Subscript operators |
|
|
|
|
|
Return the number of elements in this map. |
|
Exchange the value and comparator of this object with those of the specified |
|
|
|
|
|
Return a functor for comparing two |
Specializations
Name |
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, |
|
|
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, |
Deduction Guides
Name |
Description |
Deduce the template parameters |
|
Deduce the template parameters |
|
Deduce the template parameters |
|
Deduce the template parameters |
|
Deduce the template parameters |
|
Deduce the template parameters |
|
Deduce the template parameters |
|
Deduce the template parameters |
Non-Member Functions
Name |
Description |
Erase all the elements in the specified map |
|
Perform a lexicographic three‐way comparison of the specified |
|
Return |
|
Exchange the value and comparator of the specified |
Created with MrDocs