[#bsl-unordered_map-02b-2constructor-09b]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_map-02b.adoc[unordered&lowbar;map]::unordered&lowbar;map
:relfileprefix: ../../
:mrdocs:

Create an unordered map from the iterator range `&lsqb;first, last)&rsqb;`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;unorderedmap&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
unordered&lowbar;map(
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:bsl/unordered_map-02b/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

== Description

Create an empty unordered map, having a `max&lowbar;load&lowbar;factor` of 1&period;0, and then create a `value&lowbar;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&period; Insert into this unordered map each such object, ignoring those having a key that appears earlier in the sequence&period; Optionally specify a minimum `initialNumBuckets` indicating the minimum initial size of the array of buckets of this unordered map&period; If `initialNumBuckets` is 0 or not supplied, and `first` and `last` denote an empty range, a single empty bucket shall be supplied&period; The actual number of buckets the unordered&lowbar;map is created with shall always be enough to accommodate the number of elements of the range without exceeding the `max&lowbar;load&lowbar;factor`&period; Optionally specify a `hashFunction` used to generate hash values associated with the `KEY&hyphen;VALUE` pairs contained in this unordered map&period; If `hashFunction` is not supplied, a default&hyphen;constructed object of the (template parameter) type `HASH` is used&period; Optionally specify a key&hyphen;equality functor `keyEqual` used to verify that two keys are equivalent&period; If `keyEqual` is not supplied, a default&hyphen;constructed object of the (template parameter) type `EQUAL` is used&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is not supplied, a default&hyphen;constructed object of the (template parameter) type `ALLOCATOR` is used&period; If `ALLOCATOR` type is `bsl&colon;&colon;allocator` (the default), then `basicAllocator` shall be convertible to `bslma&colon;&colon;Allocator &ast;`&period; If the `ALLOCATOR` type is `bsl&colon;&colon;allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory&period; The (template parameter) type `INPUT&lowbar;ITERATOR` shall meet the requirements of an input iterator defined in the C&plus;&plus;11 standard &lsqb;24&period;2&period;3&rsqb;providing access to values of a type convertible to `value&lowbar;type`&period; 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`&period; Note that more than `initialNumBuckets` buckets may be created in order to preserve the bucket allocation strategy of the hash&hyphen;table (but never fewer)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *first*
| start of the range
| *last*
| end of the range (one past last)
| *initialNumBuckets*
| initial number of buckets
| *hashFunction*
| hash functor
| *keyEqual*
| key&hyphen;equality functor
| *basicAllocator*
| allocator used to supply memory
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
