[#bsl-unordered_map-02b-2constructor-0f0] = xref:bsl.adoc[bsl]::xref:bsl/unordered_map-02b.adoc[unordered_map]::unordered_map :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<bslstl_unorderedmap.h>` Create an empty unordered map. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-0c.adoc[unordered_map](); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0c.adoc[_» more..._]# Create an unordered map as a copy of `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-03.adoc[unordered_map](xref:bsl/unordered_map-02b.adoc[unordered_map] const& original); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-03.adoc[_» more..._]# Create an unordered map by moving from `original`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-05.adoc[unordered_map](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_map>] original); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-05.adoc[_» more..._]# Create an empty unordered map using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_map-02b/2constructor-04.adoc[unordered_map](ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-04.adoc[_» more..._]# Create an empty unordered map with bucket count and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-06.adoc[unordered_map]( xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-06.adoc[_» more..._]# Create an unordered map by moving from `original` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-0ee.adoc[unordered_map]( xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<unordered_map>] original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0ee.adoc[_» more..._]# Create a copy of `original` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-093.adoc[unordered_map]( xref:bsl/unordered_map-02b.adoc[unordered_map] const& original, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-093.adoc[_» more..._]# Create an unordered map from `values` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-02b/2constructor-0a.adoc[unordered_map]( std::initializer_list<value_type> values, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0a.adoc[_» more..._]# Create an empty unordered map with hash and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/unordered_map-02b/2constructor-0fd.adoc[unordered_map]( xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0fd.adoc[_» more..._]# Create an unordered map from `values` with bucket count and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-02b/2constructor-0b.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0b.adoc[_» more..._]# Create an unordered map from `[first, last)]` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-02b/2constructor-095.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-095.adoc[_» more..._]# Create an unordered map from `range` using `basicAllocator`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-02b/2constructor-0fb.adoc[unordered_map]( std::from_range_t tag, RANGE&& range, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0fb.adoc[_» more..._]# Create an empty unordered map. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:bsl/unordered_map-02b/2constructor-07b.adoc[unordered_map]( xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-07b.adoc[_» more..._]# Create an unordered map from `values` with hash and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<> requires std::is_invocable_v<HASH, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR> xref:bsl/unordered_map-02b/2constructor-028.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-028.adoc[_» more..._]# Create an unordered map from `[first, last)]` with bucket count. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-02b/2constructor-00.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-00.adoc[_» more..._]# Create an unordered map from `range` with bucket count and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-02b/2constructor-085.adoc[unordered_map]( std::from_range_t tag, RANGE&& range, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-085.adoc[_» more..._]# Create an unordered map from the specified `values` initializer list. [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-02b/2constructor-02a.adoc[unordered_map]( std::initializer_list<value_type> values, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-02a.adoc[_» more..._]# Create an unordered map from `[first, last)]` with hash and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-02b/2constructor-0ef.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-0ef.adoc[_» more..._]# Create an unordered map from `range` with hash and allocator. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-02b/2constructor-08d.adoc[unordered_map]( std::from_range_t tag, RANGE&& range, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets, HASH const& hashFunction, ALLOCATOR const& basicAllocator); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-08d.adoc[_» more..._]# Create an unordered map from the iterator range `[first, last)]`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITERATOR> xref:bsl/unordered_map-02b/2constructor-09b.adoc[unordered_map]( INPUT_ITERATOR first, INPUT_ITERATOR last, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-09b.adoc[_» more..._]# Create an unordered map from the specified `range`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class RANGE> xref:bsl/unordered_map-02b/2constructor-076.adoc[unordered_map]( std::from_range_t tag, RANGE&& range, xref:bsl/unordered_map-02b/size_type.adoc[size_type] initialNumBuckets = 0, HASH const& hashFunction = HASH(), EQUAL const& keyEqual = EQUAL(), ALLOCATOR const& basicAllocator = ALLOCATOR()); ---- [.small]#xref:bsl/unordered_map-02b/2constructor-076.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *original* | unordered map to copy or move from | *basicAllocator* | allocator used to supply memory | *initialNumBuckets* | initial number of buckets | *values* | initializer list of values to insert | *hashFunction* | hash functor | *first* | start of the range | *last* | end of the range (one past last) | *tag* | disambiguation tag for from‐range construction | *range* | input range of values to insert | *keyEqual* | key‐equality functor |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#