[#bsl-unordered_map-0bf-2constructor-0b0] = xref:bsl.adoc[bsl]::xref:bsl/unordered_map-0bf.adoc[unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>]::unordered_map :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_unorderedmap.h>` Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-0e.adoc[unordered_map](); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-0e.adoc[_» more..._]# Create an unordered map having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new unordered map. Use a copy of `original.hash_function()` to generate hash values for the keys contained in this unordered map. 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 map. `original` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-044.adoc[unordered_map](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>>] original); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-044.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_map-0bf/2constructor-0b8.adoc[unordered_map](xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-0b8.adoc[_» more..._]# Create an unordered map having the same value, hasher, key‐equality comparator, and `max_load_factor` as the specified `original`. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to supply memory. If the `ALLOCATOR` type is `bsl::allocator` (the default), the currently installed default allocator is used to supply memory. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-06e.adoc[unordered_map](xref:bsl/unordered_map-02b.adoc[unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>] const& original); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-06e.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-061.adoc[unordered_map]( xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-061.adoc[_» more..._]# Create an unordered map having the same value, hasher, key‐equality comparator, and `max_load_factor` as the specified `original`. Use the specified `basicAllocator` to supply memory. This method requires that the (template parameter) type `value_type` be `move‐insertable` into this `unordered_map` (see {Requirements on `value_type`}). Note that a `bslma::Allocator *` can be supplied for `basicAllocator` if the (template parameter) `ALLOCATOR` type is `bsl::allocator` (the default). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-01.adoc[unordered_map]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>>] original, type_identity<allocator<pair<basic_string<char> const, Json>>>::type const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-01.adoc[_» more..._]# Create an unordered map having the same value, hasher, key‐equality comparator, and `max_load_factor` as the specified `original`, and using the specified `basicAllocator` to supply memory. If the `ALLOCATOR` type is `bsl::allocator` (the default), then `basicAllocator` shall be convertible to `bslma::Allocator *`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-05a.adoc[unordered_map]( xref:bsl/unordered_map-02b.adoc[unordered_map<basic_string<char>, Json, TransparentHash, TransparentEqualTo>] const& original, type_identity<allocator<pair<basic_string<char> const, Json>>>::type const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-05a.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-0bf/2constructor-02f1.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-02f1.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-0bf/2constructor-052.adoc[unordered_map]( xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-052.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-0bf/2constructor-02f9.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-02f9.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-0bf/2constructor-03.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-03.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-0bf/2constructor-06a.adoc[unordered_map]( std::from_range_t, RANGE&& range, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-06a.adoc[_» more..._]# Create an empty unordered map having a `max_load_factor` of 1.0. Optionally specify an `initialNumBuckets` indicating the minimum initial size of the array of buckets of this unordered map. If `initialNumBuckets` is not supplied, one empty bucket shall be used and no memory allocated. Optionally specify a `hashFunction` used to generate the hash values associated with the `KEY‐VALUE` pairs contained in this unordered map. 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 are equivalent. If `keyEqual` is not supplied, a default‐constructed object of the (template parameter) type `EQUAL` is used. Optionally specify the `basicAllocator` used to supply memory. If `basicAllocator` is not supplied, a default‐constructed object of the (template parameter) type `ALLOCATOR` is used. If the `ALLOCATOR` type is `bsl::allocator` (the default), then `basicAllocator` shall be convertible to `bslma::Allocator *`. If the `ALLOCATOR` type is `bsl::allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory. Note that more than `initialNumBuckets` buckets may be created in order to preserve the bucket allocation strategy of the hash‐table (but never fewer). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_map-0bf/2constructor-042.adoc[unordered_map]( xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction = HASH(), xref:BloombergLP/bdlb/TransparentEqualTo.adoc[TransparentEqualTo] const& keyEqual = EQUAL(), xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-042.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires std::is_invocable_v<HASH, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-0bf/2constructor-08.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-08.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-0bf/2constructor-02e.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-02e.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-0bf/2constructor-024.adoc[unordered_map]( std::from_range_t, RANGE&& range, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-024.adoc[_» more..._]# Create an empty unordered map, having a `max_load_factor` of 1.0, and then create a `value_type` object for each element in the specified `values` list, ignoring those having a key that appears earlier in the sequence. Optionally specify a minimum `initialNumBuckets`, `hashFunction`, `keyEqual`, and `basicAllocator` as for the range constructor. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires std::is_invocable_v<HASH, const KEY &> && std::is_invocable_v<EQUAL, const KEY &, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-0bf/2constructor-09.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets = 0, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction = HASH(), xref:BloombergLP/bdlb/TransparentEqualTo.adoc[TransparentEqualTo] const& keyEqual = EQUAL(), xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-09.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-0bf/2constructor-02c.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-02c.adoc[_» more..._]# Same as the preceding overload. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-0bf/2constructor-0b7.adoc[unordered_map]( std::from_range_t, RANGE&& range, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction, xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-0b7.adoc[_» more..._]# Create an empty unordered map, having a `max_load_factor` of 1.0, and then create a `value_type` object for each iterator in the range starting at the specified `first` iterator and ending immediately before the specified `last` iterator, by converting from the object referred to by each iterator. Insert into this unordered map each such object, ignoring those having a key that appears earlier in the sequence. Optionally specify a minimum `initialNumBuckets` indicating the minimum initial size of the array of buckets of this unordered map. If `initialNumBuckets` is 0 or not supplied, and `first` and `last` denote an empty range, a single empty bucket shall be supplied. The actual number of buckets the unordered_map is created with shall always be enough to accommodate the number of elements of the range without exceeding the `max_load_factor`. Optionally specify a `hashFunction` used to generate hash values associated with the `KEY‐VALUE` pairs contained in this unordered map. 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 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 `ALLOCATOR` type is `bsl::allocator` (the default), then `basicAllocator` shall be convertible to `bslma::Allocator *`. If the `ALLOCATOR` type 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`. 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 more than `initialNumBuckets` buckets may be created in order to preserve the bucket allocation strategy of the hash‐table (but never fewer). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-0bf/2constructor-023.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets = 0, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction = HASH(), xref:BloombergLP/bdlb/TransparentEqualTo.adoc[TransparentEqualTo] const& keyEqual = EQUAL(), xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-023.adoc[_» more..._]# Create an unordered set, and insert each `value_type` object in the specified `range`, ignoring those keys having a key equivalent to that which appears earlier in the `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 set. 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_map-0bf/2constructor-066.adoc[unordered_map]( std::from_range_t, RANGE&& range, xref:bsl/unordered_map-0bf/size_type.adoc[size_type] initialNumBuckets = 0, xref:BloombergLP/bdlb/TransparentHash.adoc[TransparentHash] const& hashFunction = HASH(), xref:BloombergLP/bdlb/TransparentEqualTo.adoc[TransparentEqualTo] const& keyEqual = EQUAL(), xref:bsl/allocator-0df.adoc[allocator<pair<basic_string<char> const, Json>>] const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-0bf/2constructor-066.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#