bsl::unordered_map::unordered_map

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).

Synopsis

Declared in <bslstl_unorderedmap.h>

template<class INPUT_ITERATOR>
unordered_map(
    INPUT_ITERATOR first,
    INPUT_ITERATOR last,
    size_type initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());