[#bsl-map-0c7-2constructor-0e] = xref:bsl.adoc[bsl]::xref:bsl/map-0c7.adoc[map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>]::map :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_map.h>` Create an empty map. Optionally specify a `comparator` used to order key‐value pairs contained in this object. If `comparator` is not supplied, a default‐constructed object of the (template parameter) type `COMPARATOR` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, a default‐constructed object of the (template parameter) type `ALLOCATOR` is used. If the type `ALLOCATOR` is `bsl::allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma::Allocator *`. If the type `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-02.adoc[map](); ---- [.small]#xref:bsl/map-0c7/2constructor-02.adoc[_» more..._]# Create a map having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new map. Use a copy of `original.key_comp()` to order the key‐value pairs contained in this map. The allocator associated with `original` is propagated for use in the newly‐created map. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-00.adoc[map](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] original); ---- [.small]#xref:bsl/map-0c7/2constructor-00.adoc[_» more..._]# Create an empty map that uses the specified `basicAllocator` to supply memory. Use a default‐constructed object of the (template parameter) type `COMPARATOR` to order the key‐value pairs contained in this map. Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/map-0c7/2constructor-07.adoc[map](xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator); ---- [.small]#xref:bsl/map-0c7/2constructor-07.adoc[_» more..._]# Create a map having the same value as the specified `original` object. Use a copy of `original.key_comp()` to order the key‐value pairs contained in this map. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to allocate memory. If the (template parameter) type `ALLOCATOR` is `bsl::allocator` (the default), the currently installed default allocator is used. This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy‐insertable` into this map (see {Requirements on `KEY` and `VALUE`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-044.adoc[map](xref:bsl/map-0a7.adoc[map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>] const& original); ---- [.small]#xref:bsl/map-0c7/2constructor-044.adoc[_» more..._]# Create a map having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. The contents of `original` are moved (in constant time) to the new map if `basicAllocator == original.get_allocator()`, and are move‐ inserted (in linear time) using `basicAllocator` otherwise. `original` is left in a valid but unspecified state. Use a copy of `original.key_comp()` to order the key‐value pairs contained in this map. This method requires that the (template parameter) types `KEY` and `VALUE` both be `move‐insertable` into this map (see {Requirements on `KEY` and `VALUE`}). Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-0a.adoc[map]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] original, type_identity<allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>>::type const& basicAllocator); ---- [.small]#xref:bsl/map-0c7/2constructor-0a.adoc[_» more..._]# Create a map containing the elements from the specified `values` initializer list, using the specified `basicAllocator` to supply memory. If `basicAllocator` is 0, the currently installed default allocator is used. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-038.adoc[map]( std::initializer_list<value_type> values, xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator); ---- [.small]#xref:bsl/map-0c7/2constructor-038.adoc[_» more..._]# Create an empty map using the specified `comparator` and `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/map-0c7/2constructor-0c.adoc[map]( less<int> const& comparator, xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/map-0c7/2constructor-0c.adoc[_» more..._]# Create a map having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. Use a copy of `original.key_comp()` to order the key‐value pairs contained in this map. This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy‐insertable` into this map (see {Requirements on `KEY` and `VALUE`}). Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-045.adoc[map]( xref:bsl/map-0a7.adoc[map<int, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>] const& original, type_identity<allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>>::type const& basicAllocator); ---- [.small]#xref:bsl/map-0c7/2constructor-045.adoc[_» more..._]# Create a map and insert each `value_type` object in the specified `values` initializer list, ignoring those objects having a key equivalent to that which appears earlier in the list. Optionally specify a `comparator` used to order keys contained in this object. If `comparator` is not supplied, a default‐constructed object of the (template parameter) type `COMPARATOR` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, a default‐constructed object of the (template parameter) type `ALLOCATOR` is used. If the type `ALLOCATOR` is `bsl::allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma::Allocator *`. If the type `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used. If `values` is ordered according to `comparator`, then this operation has `O[N]` complexity, where `N` is the number of elements in `values`; otherwise, this operation has `O[N * log(N)]` complexity. This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy‐insertable` into this map (see {Requirements on `KEY` and `VALUE`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/map-0c7/2constructor-0f.adoc[map]( std::initializer_list<value_type> values, less<int> const& comparator = COMPARATOR(), xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/map-0c7/2constructor-0f.adoc[_» more..._]# Same as the preceding overload, omitting `comparator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/map-0c7/2constructor-036.adoc[map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator); ---- [.small]#xref:bsl/map-0c7/2constructor-036.adoc[_» more..._]# Create a map having the (`value_type`) values obtained from the specified `range`, using the specified `basicAllocator` to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/map-0c7/2constructor-039.adoc[map]( std::from_range_t, RANGE&& range, xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator); ---- [.small]#xref:bsl/map-0c7/2constructor-039.adoc[_» more..._]# Create a map, and insert each `value_type` object in the sequence starting at the specified `first` element, and ending immediately before the specified `last` element, ignoring those objects having a key equivalent to that which appears earlier in the sequence. Optionally specify a `comparator` used to order key‐value pairs contained in this object. If `comparator` is not supplied, a default‐constructed object of the (template parameter) type `COMPARATOR` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, a default‐constructed object of the (template parameter) type `ALLOCATOR` is used. If the type `ALLOCATOR` is `bsl::allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma::Allocator *`. If the type `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used. If the sequence `first` to `last` is ordered according to `comparator`, then this operation has `O[N]` complexity, where `N` is the number of elements between `first` and `last`; otherwise, this operation has `O[N * log(N)]` complexity. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/map-0c7/2constructor-08.adoc[map]( INPUT_ITERATOR first, INPUT_ITERATOR last, less<int> const& comparator = COMPARATOR(), xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/map-0c7/2constructor-08.adoc[_» more..._]# Create a map having the (`value_type`) values obtained from the specified `range`. Ignore those those objects having a key equivalent to that which appears earlier in the sequence. Optionally specify a `comparator` used to order key‐value pairs contained in this object. If `comparator` is not supplied, a default‐constructed object of the (template parameter) type `COMPARATOR` is used. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, a default‐constructed object of the (template parameter) type `ALLOCATOR` is used. If the type `ALLOCATOR` is `bsl::allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma::Allocator *`. If the type `ALLOCATOR` is `bsl::allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used. If values obtained from `range are ordered according to `comparator`, then this operation has `O[N]` complexity, where `N` is the number of values in the `range`; otherwise, this operation has `O[N * log(N)]` complexity. Note that `RANGE` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to `value_type`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/map-0c7/2constructor-05.adoc[map]( std::from_range_t, RANGE&& range, less<int> const& comparator = COMPARATOR(), xref:bsl/allocator-0df.adoc[allocator<pair<int const, pair<shared_ptr<Statistics>, shared_ptr<Collector<OsLinux>>>>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/map-0c7/2constructor-05.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#