Create an unordered map from the specified values initializer list.

Synopsis

Declared in <bslstl_unorderedmap.h>

template<>
requires std::is_invocable_v<HASH, const KEY &> && std::is_invocable_v<EQUAL, const KEY &, const KEY &> && bsl::IsStdAllocator_v<ALLOCATOR>
unordered_map(
    std::initializer_list<value_type> values,
    size_type initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());

Description

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.

Parameters

Name

Description

values

initializer list of values to insert

initialNumBuckets

initial number of buckets

hashFunction

hash functor

keyEqual

key‐equality functor

basicAllocator

allocator used to supply memory

Created with MrDocs