bsl::map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>

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 map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>;

Description

This class: * supports a complete set of value-semantic operations

  • except for BDEX serialization * is exception-neutral * is alias-safe * is const thread-safe For terminology see {bsldoc_glossary}.

Types

NameDescription
value_compare This nested class defines a mechanism for comparing two objects of value_type by adapting an object of (template parameter) type COMPARATOR, which compares two objects of (template parameter) type KEY . Note that this class exactly matches its definition in the C++11 standard [map.overview]; otherwise, we would have implemented it as a separate component-local class.

Type Aliases

NameDescription
allocator_type Alias for the allocator type ALLOCATOR.
const_iterator Constant bidirectional iterator over map elements.
const_pointer Alias for the const pointer type supplied by the allocator traits.
const_reference Alias for a constant reference to a map element.
const_reverse_iterator Reverse iterator type for traversing the map in reverse order.
difference_type Signed integer type measuring iterator distance.
iterator Bidirectional iterator over map elements.
key_compare Alias for the key-comparison functor type COMPARATOR.
key_type Alias for the key type KEY.
mapped_type Alias for the mapped value type VALUE.
pointer Alias for the pointer type supplied by the allocator traits.
reference Alias for a modifiable reference to a map element.
reverse_iterator Reverse iterator over map elements.
size_type Alias for the size type supplied by the allocator traits.
value_type Alias for the map element type pair<const KEY, VALUE>.

Member Functions

NameDescription
map [constructor]Constructors
~map [destructor]Destroy this object.
operator= Assignment operators
at at overloads
begin begin overloads
cbegin Return an iterator providing non-modifiable access to the first value_type object in the ordered sequence of value_type objects maintained by this map, or the cend iterator if this map is empty.
cend Return an iterator providing non-modifiable access to the past-the-end element in the ordered sequence of value_type objects maintained by this map.
clear Remove all entries from this map. Note that the map is empty after this call, but allocated memory may be retained for future use.
contains Return true if this map contains an element whose key is equivalent to the specified key.
count count overloads
crbegin Return a reverse iterator providing non-modifiable access to the last value_type object in the ordered sequence of value_type objects maintained by this map, or crend if this map is empty.
crend Return a reverse iterator providing non-modifiable access to the prior-to-the-beginning element in the ordered sequence of value_type objects maintained by this map.
emplace Insert into this map a newly-created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type, if a key equivalent to such a value does not already exist in this map; otherwise, this method has no effect (other than possibly creating a temporary value_type object). Return a pair whose first member is an iterator referring to the (possibly newly created and inserted) object in this map whose key is equivalent to that of an object constructed from args, and whose second member is true if a new value was inserted, and false if an equivalent key was already present. This method requires that the (template parameter) types KEY and VALUE both be emplace-constructible from args (see {Requirements on KEY and VALUE}).
emplace_hint Insert into this map a newly-created value_type object, constructed by forwarding get_allocator() (if required) and the specified (variable number of) args to the corresponding constructor of value_type (in amortized constant time if the specified hint is a valid immediate successor to the value_type object constructed from args), if a key equivalent to such a value does not already exist in this map; otherwise, this method has no effect (other than possibly creating a temporary value_type object). Return an iterator referring to the (possibly newly created and inserted) object in this map whose key is equivalent to that of an object constructed from args. If hint is not a valid immediate successor to the value_type object implied by args, this operation has O[log(N)] complexity where N is the size of this map. This method requires that the (template parameter) types KEY and VALUE both be emplace-constructible from args (see {Requirements on KEY and VALUE}). The behavior is undefined unless hint is an iterator in the range [begin() .. end()] (both endpoints included).
empty Return true if this map contains no elements, and false otherwise.
end end overloads
equal_range equal_range overloads
erase erase overloads
find find overloads
get_allocator Return (a copy of) the allocator used for memory allocation by this map.
insert insert overloads
insert_or_assign insert_or_assign overloads
insert_range Insert into this map the value of each value_type object in the specified range if the key equivalent of that object is not already contained in this map. The (template parameter) type RANGE must meet the requirements the C++20 standard [ranges]providing access to values of a type convertible to value_type, and value_type must be emplace-constructible from *i into this map, where i is a dereferenceable iterator obtained from range (see {Requirements on KEY and VALUE}). The behavior is undefined if range overlaps this map.
key_comp 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 key_compare object. Note that this comparator compares objects of type KEY, which is the key part of the value_type objects contained in this map.
lower_bound lower_bound overloads
max_size 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.
operator[] Subscript operators
rbegin rbegin overloads
rend rend overloads
size Return the number of elements in this map.
swap Exchange the value and comparator of this object with those of the specified other object; also exchange the allocator of this object with that of other if the (template parameter) type ALLOCATOR has the propagate_on_container_swap trait, and do not modify either allocator otherwise. This method provides the no-throw exception-safety guarantee if and only if the (template parameter) type COMPARATOR provides a no-throw swap operation, and provides the basic exception-safety guarantee otherwise; if an exception is thrown, both objects are left in valid but unspecified states. This operation has O[1] complexity if either this object was created with the same allocator as other or ALLOCATOR has the propagate_on_container_swap trait; otherwise, it has O[n + m] complexity, where n and m are the number of elements in this object and other, respectively. Note that this method's support for swapping objects created with different allocators when ALLOCATOR does not have the propagate_on_container_swap trait is a departure from the C++ Standard.
try_emplace try_emplace overloads
upper_bound upper_bound overloads
value_comp Return a functor for comparing two value_type objects by comparing their respective keys using key_comp(). Note that this comparator compares objects of type value_type (i.e., bsl::pair<const KEY, VALUE>).