[#bsl-unordered_multiset-06c-2constructor-0ab]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_multiset-06c.adoc[unordered&lowbar;multiset]::unordered&lowbar;multiset
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Create an empty unordered multiset&period; Optionally specify an `initialNumBuckets` indicating the initial size of the array of buckets of this container&period; If `initialNumBuckets` is not supplied, a single bucket is used&period; Optionally specify a `hashFunction` used to generate the hash values for the keys contained in this unordered multiset&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 the type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma&colon;&colon;Allocator &ast;`&period; If the type `ALLOCATOR` is `bsl&colon;&colon;allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-09e.adoc[unordered&lowbar;multiset]();
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-09e.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset having the same value as the specified `original` object&period; Use a copy of `original&period;hash&lowbar;function()` to generate hash values for the keys contained in this unordered multiset&period; Use a copy of `original&period;key&lowbar;eq()` to verify that two keys are equivalent&period; Use the allocator returned by &grave;bsl&colon;&colon;allocator&lowbar;traits&lt;ALLOCATOR&gt;&colon;&colon; select&lowbar;on&lowbar;container&lowbar;copy&lowbar;construction(original&period;get&lowbar;allocator())&grave; to allocate memory&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this unordered multiset (see &lcub;Requirements on `KEY`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-00.adoc[unordered&lowbar;multiset](xref:bsl/unordered_multiset-06c.adoc[unordered&lowbar;multiset] const& original);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-00.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset having the same value as the specified `original` object by moving (in constant time) the contents of `original` to the new unordered multiset&period; Use a copy of `original&period;hash&lowbar;function()` to generate hash values for the keys contained in this unordered multiset&period; Use a copy of `original&period;key&lowbar;eq()` to verify that two keys are equivalent&period; The allocator associated with `original` is propagated for use in the newly&hyphen;created unordered multiset&period; `original` is left in a valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-0e0d.adoc[unordered&lowbar;multiset](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;unordered&lowbar;multiset&gt;] original);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0e0d.adoc[_» more&period;&period;&period;_]#

Same as the related overload above for `unordered&lowbar;multiset`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/unordered_multiset-06c/2constructor-0c.adoc[unordered&lowbar;multiset](ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-017.adoc[unordered&lowbar;multiset](
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-017.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory&period; The contents of `original` are moved (in constant time) to the new unordered multiset if &grave;basicAllocator &equals;&equals; original&period;get&lowbar;allocator()&grave;, and are move&hyphen;inserted (in linear time) using `basicAllocator` otherwise&period; `original` is left in a valid but unspecified state&period; Use a copy of `original&period;hash&lowbar;function()` to generate hash values for the keys contained in this unordered multiset&period; Use a copy of `original&period;key&lowbar;eq()` to verify that two keys are equivalent&period; This method requires that the (template parameter) type `KEY` be `move&hyphen;insertable` into this unordered multiset (see &lcub;Requirements on `KEY`&rcub;)&period; Note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the (template parameter) type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-075.adoc[unordered&lowbar;multiset](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;unordered&lowbar;multiset&gt;] original,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-075.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory&period; Use a copy of `original&period;hash&lowbar;function()` to generate hash values for the keys contained in this unordered multiset&period; Use a copy of `original&period;key&lowbar;eq()` to verify that two keys are equivalent&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this unordered multiset (see &lcub;Requirements on `KEY`&rcub;)&period; Note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the (template parameter) type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-03a.adoc[unordered&lowbar;multiset](
    xref:bsl/unordered_multiset-06c.adoc[unordered&lowbar;multiset] const& original,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-03a.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset and insert each `value&lowbar;type` object in the specified `values` initializer list&period; Optionally specify an `initialNumBuckets` indicating the initial size of the array of buckets of this container&period; If `initialNumBuckets` is not supplied, a single bucket is used&period; Optionally specify a `hashFunction` used to generate the hash values for the keys contained in this unordered multiset&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 the type `ALLOCATOR` is `bsl&colon;&colon;allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used to supply memory&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this unordered multiset (see &lcub;Requirements on `KEY`&rcub;)&period; Note that a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class = void&gt;
requires bsl&colon;&colon;IsStdAllocator&lt;ALLOCATOR&gt;&colon;&colon;value
xref:bsl/unordered_multiset-06c/2constructor-0a9.adoc[unordered&lowbar;multiset](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0a9.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_multiset-06c/2constructor-071.adoc[unordered&lowbar;multiset](
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-071.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_multiset-06c/2constructor-0e09.adoc[unordered&lowbar;multiset](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0e09.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_multiset-06c/2constructor-0e1.adoc[unordered&lowbar;multiset](
    std::from&lowbar;range&lowbar;t,
    RANGE&& range,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0e1.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class = void&gt;
requires bsl&colon;&colon;IsStdAllocator&lt;ALLOCATOR&gt;&colon;&colon;value
xref:bsl/unordered_multiset-06c/2constructor-036.adoc[unordered&lowbar;multiset](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-036.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified bucket count and hash&sol;equality functors&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/unordered_multiset-06c/2constructor-02.adoc[unordered&lowbar;multiset](
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-02.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_multiset-06c/2constructor-019.adoc[unordered&lowbar;multiset](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-019.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_multiset-06c/2constructor-018.adoc[unordered&lowbar;multiset](
    std::from&lowbar;range&lowbar;t,
    RANGE&& range,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-018.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class = void,
    class = void&gt;
requires std&colon;&colon;is&lowbar;invocable&lowbar;v&lt;HASH, const KEY &amp;&gt; &amp;&amp; bsl&colon;&colon;IsStdAllocator&lt;ALLOCATOR&gt;&colon;&colon;value
xref:bsl/unordered_multiset-06c/2constructor-0e3.adoc[unordered&lowbar;multiset](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0e3.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, using the specified allocator&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/unordered_multiset-06c/2constructor-04a.adoc[unordered&lowbar;multiset](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-04a.adoc[_» more&period;&period;&period;_]#

Create an `unordered&lowbar;multiset` from the specified `range`, using the optionally specified `initialNumBuckets`, `hashFunction`, `keyEqual`, and `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_multiset-06c/2constructor-06.adoc[unordered&lowbar;multiset](
    std::from&lowbar;range&lowbar;t,
    RANGE&& range,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-06.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset from the specified `values` initializer list&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class = void,
    class = void,
    class = void&gt;
requires std&colon;&colon;is&lowbar;invocable&lowbar;v&lt;HASH, const KEY &amp;&gt; &amp;&amp; std&colon;&colon;is&lowbar;invocable&lowbar;v&lt;EQUAL, const KEY &amp;, const KEY &amp;&gt; &amp;&amp; bsl&colon;&colon;IsStdAllocator&lowbar;v&lt;ALLOCATOR&gt;
xref:bsl/unordered_multiset-06c/2constructor-047.adoc[unordered&lowbar;multiset](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-047.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset, and insert each `value&lowbar;type` object in the sequence starting at the specified `first` element, and ending immediately before the specified `last` element&period; Optionally specify an `initialNumBuckets` indicating the initial size of the array of buckets of this container&period; If `initialNumBuckets` is not supplied, a single bucket is used&period; Optionally specify a `hashFunction` used to generate hash values for the keys contained in this unordered multiset&period; If `hashFunction` is not supplied, a default&hyphen;constructed object of (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 (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 the type `ALLOCATOR` 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`, and `value&lowbar;type` must be `emplace&hyphen;constructible` from `&ast;i` into this unordered multiset, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;` (see &lcub;Requirements on `KEY`&rcub;)&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 a `bslma&colon;&colon;Allocator &ast;` can be supplied for `basicAllocator` if the type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default)&period;


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

[.small]#xref:bsl/unordered_multiset-06c/2constructor-0aa.adoc[_» more&period;&period;&period;_]#

Create an unordered multiset, and insert each `value&lowbar;type` object in the specified `range`&period; Optionally specify an `initialNumBuckets` indicating the initial size of the array of buckets of this container&period; If `initialNumBuckets` is not supplied, an implementation&hyphen;defined value is used&period; Optionally specify a `hashFunction` used to generate the hash values for each key value contained in this unordered multiset&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 determine whether two keys have the same value&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 the type `ALLOCATOR` is `bsl&colon;&colon;allocator` (the default), then `basicAllocator`, if supplied, shall be convertible to `bslma&colon;&colon;Allocator &ast;`&period; If the type `ALLOCATOR` is `bsl&colon;&colon;allocator` and `basicAllocator` is not supplied, the currently installed default allocator is used&period; This operation has `O&lsqb;N&rsqb;` complexity, where `N` is the number of elements in `range`&period; 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&lowbar;type`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_multiset-06c/2constructor-090.adoc[unordered&lowbar;multiset](
    std::from&lowbar;range&lowbar;t,
    RANGE&& range,
    xref:bsl/unordered_multiset-06c/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/unordered_multiset-06c/2constructor-090.adoc[_» more&period;&period;&period;_]#


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