[#bsl-unordered_multimap-0b0-2constructor-06] = xref:bsl.adoc[bsl]::xref:bsl/unordered_multimap-0b0.adoc[unordered_multimap]::unordered_multimap :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_unorderedmultimap.h>` Create an empty unordered multimap. Optionally specify an `initialNumBuckets` indicating the minimum initial size of the array of buckets of this container. If `initialNumBuckets` is not supplied, a single empty bucket is used. Optionally specify a `hashFunction` used to generate the hash values for the keys contained in this unordered multimap. If `hashFunction` is not supplied, a default‐constructed object of the (template parameter) type `HASH` is used. Optionally specify a key‐equivalence functor `keyEqual` used to verify that two keys are equivalent. If `keyEqual` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` 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/unordered_multimap-0b0/2constructor-0f.adoc[unordered_multimap](); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0f.adoc[_» more..._]# Create an unordered multimap having the same value as the specified `original` object. Use a copy of `original.hash_function()` to generate hash values for the keys contained in this unordered multimap. Use a copy of `original.key_eq()` to verify that two keys are equivalent. Use the allocator returned by `bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())` to allocate memory. This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy‐insertable` into this unordered multimap (see {Requirements on `KEY` and `VALUE`}). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multimap-0b0/2constructor-02b.adoc[unordered_multimap](xref:bsl/unordered_multimap-0b0.adoc[unordered_multimap] const& original); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-02b.adoc[_» more..._]# Create an unordered multimap having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new unordered multimap. Use a copy of `original.hash_function()` to generate hash values for the keys contained in this unordered multimap. Use a copy of `original.key_eq()` to verify that two keys are equivalent. The allocator associated with `original` is propagated for use in the newly‐created unordered multimap. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multimap-0b0/2constructor-01.adoc[unordered_multimap](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_multimap>] original); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-01.adoc[_» more..._]# Same as the related overload above for `unordered_multimap`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_multimap-0b0/2constructor-0ab6.adoc[unordered_multimap](ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0ab6.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multimap-0b0/2constructor-022.adoc[unordered_multimap]( xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-022.adoc[_» more..._]# Create an unordered multimap 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 unordered multimap 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.hash_function()` to generate hash values for the keys contained in this unordered multimap. Use a copy of `original.key_eq()` to verify that two keys are equivalent. This method requires that the (template parameter) types `KEY` and `VALUE` both be `move‐insertable` into this unordered multimap (see {Requirements on `KEY` and `VALUE`}). Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the (template parameter) type `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multimap-0b0/2constructor-030.adoc[unordered_multimap]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_multimap>] original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-030.adoc[_» more..._]# Create an unordered multimap having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory. Use a copy of `original.hash_function()` to generate hash values for the keys contained in this unordered multimap. Use a copy of `original.key_eq()` to verify that two keys are equivalent. This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy‐insertable` into this unordered multimap (see {Requirements on `KEY` and `VALUE`}). Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the (template parameter) type `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multimap-0b0/2constructor-0c.adoc[unordered_multimap]( xref:bsl/unordered_multimap-0b0.adoc[unordered_multimap] const& original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0c.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class = void> requires bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_multimap-0b0/2constructor-0ab9.adoc[unordered_multimap]( std::initializer_list<value_type> values, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0ab9.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_multimap-0b0/2constructor-0b4.adoc[unordered_multimap]( xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0b4.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_multimap-0b0/2constructor-04.adoc[unordered_multimap]( INPUT_ITERATOR first, INPUT_ITERATOR last, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-04.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_multimap-0b0/2constructor-037.adoc[unordered_multimap]( std::from_range_t, RANGE&& range, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-037.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class = void> requires bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_multimap-0b0/2constructor-07.adoc[unordered_multimap]( std::initializer_list<value_type> values, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-07.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_multimap-0b0/2constructor-09d.adoc[unordered_multimap]( xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-09d.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_multimap-0b0/2constructor-05.adoc[unordered_multimap]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-05.adoc[_» more..._]# Same as the related overload above for `unordered_multimap`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_multimap-0b0/2constructor-002.adoc[unordered_multimap]( std::from_range_t, RANGE&& range, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-002.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class = void, class = void> requires std::is_invocable_v<HASH, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_multimap-0b0/2constructor-090.adoc[unordered_multimap]( std::initializer_list<value_type> values, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-090.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_multimap-0b0/2constructor-0e.adoc[unordered_multimap]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0e.adoc[_» more..._]# Same as the related overload above for `unordered_multimap`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_multimap-0b0/2constructor-08.adoc[unordered_multimap]( std::from_range_t, RANGE&& range, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-08.adoc[_» more..._]# Create an unordered multimap and insert each `value_type` object in the specified `values` initializer list. Optionally specify an `initialNumBuckets` indicating the minimum initial size of the array of buckets of this container. If `initialNumBuckets` is not supplied, a single empty bucket is used if `values` is empty, and an unspecified number of buckets is used otherwise. Optionally specify a `hashFunction` used to generate the hash values for the keys contained in this unordered multimap. If `hashFunction` is not supplied, a default‐constructed object of the (template parameter) type `HASH` is used. Optionally specify a key‐equivalence functor `keyEqual` used to verify that two keys are equivalent. If `keyEqual` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` 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` and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory. This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy‐insertable` into this unordered multimap (see {Requirements on `KEY` and `VALUE`}). Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the type `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class = void, class = void, class = void> requires std::is_invocable_v<HASH, const KEY &> && std::is_invocable_v<EQUAL, const KEY &, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_multimap-0b0/2constructor-021.adoc[unordered_multimap]( std::initializer_list<value_type> values, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-021.adoc[_» more..._]# Create an unordered multimap, and insert each `value_type` object in the sequence starting at the specified `first` element, and ending immediately before the specified `last` element. Optionally specify an `initialNumBuckets` indicating the minimum initial size of the array of buckets of this container. If `initialNumBuckets` is not supplied, a single empty bucket is used if `first` and `last` denote an empty range, and an unspecified number of buckets is used otherwise. Optionally specify a `hashFunction` used to generate hash values for the keys contained in this unordered multimap. If `hashFunction` is not supplied, a default‐constructed object of (template parameter) type `HASH` is used. Optionally specify a key‐equivalence functor `keyEqual` used to verify that two keys are equivalent. If `keyEqual` is not supplied, a default‐constructed object of (template parameter) type `EQUAL` 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` and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory. The (template parameter) type `INPUT_ITERATOR` shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to `value_type`, and `value_type` must be `emplace‐constructible` from `*i` into this unordered multimap, where `i` is a dereferenceable iterator in the range `[first .. last)]` (see {Requirements on `KEY` and `VALUE`}). The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`. Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the type `ALLOCATOR` is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_multimap-0b0/2constructor-00c.adoc[unordered_multimap]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-00c.adoc[_» more..._]# Create an unordered multimap, and insert each `value_type` object in the specified `range`. Optionally specify an `initialNumBuckets` indicating the initial size of the array of buckets of this container. If `initialNumBuckets` is not supplied, an implementation‐defined value is used. Optionally specify a `hashFunction` used to generate the hash values for each key value contained in this unordered multimap. If `hashFunction` is not supplied, a default‐constructed object of the (template parameter) type `HASH` is used. Optionally specify a key‐equality functor `keyEqual` used to determine whether two keys have the same value. If `keyEqual` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` 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. This operation has `O[N]` complexity, where `N` is the number of elements in `range`. 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/unordered_multimap-0b0/2constructor-0b3.adoc[unordered_multimap]( std::from_range_t, RANGE&& range, xref:bsl/unordered_multimap-0b0/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_multimap-0b0/2constructor-0b3.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#