[#bsl-unordered_set-0d2d-2constructor-059]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_set-0d2d.adoc[unordered&lowbar;set]::unordered&lowbar;set
:relfileprefix: ../../
:mrdocs:

Constructors

== Synopses

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

Create an empty unordered set&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/2constructor-00.adoc[unordered&lowbar;set]();
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-00.adoc[_» more&period;&period;&period;_]#

Create an unordered set having the same value as the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/2constructor-053.adoc[unordered&lowbar;set](xref:bsl/unordered_set-0d2d.adoc[unordered&lowbar;set] const& original);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-053.adoc[_» more&period;&period;&period;_]#

Create an unordered set by moving the contents of the specified `original`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/2constructor-013.adoc[unordered&lowbar;set](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;unordered&lowbar;set&gt;] original);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-013.adoc[_» more&period;&period;&period;_]#

Create an empty unordered set using the specified `basicAllocator`&period;


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

[.small]#xref:bsl/unordered_set-0d2d/2constructor-0a6.adoc[_» more&period;&period;&period;_]#

Create an empty unordered set with the specified parameters&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/2constructor-0d.adoc[unordered&lowbar;set](
    xref:bsl/unordered_set-0d2d/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-0d.adoc[_» more&period;&period;&period;_]#

Create an unordered set by moving `original`, using `basicAllocator`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/2constructor-056.adoc[unordered&lowbar;set](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;unordered&lowbar;set&gt;] original,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-056.adoc[_» more&period;&period;&period;_]#

Create an unordered set having the same value as the specified `original` object that uses the specified `basicAllocator` to supply memory&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/2constructor-07.adoc[unordered&lowbar;set](
    xref:bsl/unordered_set-0d2d.adoc[unordered&lowbar;set] const& original,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-07.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified `values` initializer list&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_set-0d2d/2constructor-0c.adoc[unordered&lowbar;set](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    ALLOCATOR const& basicAllocator);
----

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

Create an empty unordered set with the specified parameters&period;


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

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

Create an unordered set from the specified iterator range&period;


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

[.small]#xref:bsl/unordered_set-0d2d/2constructor-0a8.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified `range`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_set-0d2d/2constructor-02f.adoc[unordered&lowbar;set](
    std::from&lowbar;range&lowbar;t tag,
    RANGE&& range,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-02f.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified `values` initializer list&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_set-0d2d/2constructor-030e.adoc[unordered&lowbar;set](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    xref:bsl/unordered_set-0d2d/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-030e.adoc[_» more&period;&period;&period;_]#

Create an empty unordered set with the specified bucket count&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:bsl/unordered_set-0d2d/2constructor-015.adoc[unordered&lowbar;set](
    xref:bsl/unordered_set-0d2d/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-015.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified iterator range&period;


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

[.small]#xref:bsl/unordered_set-0d2d/2constructor-0f.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified `range`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class RANGE&gt;
xref:bsl/unordered_set-0d2d/2constructor-030d.adoc[unordered&lowbar;set](
    std::from&lowbar;range&lowbar;t tag,
    RANGE&& range,
    xref:bsl/unordered_set-0d2d/size_type.adoc[size&lowbar;type] initialNumBuckets,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-030d.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified `values` initializer list&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_set-0d2d/2constructor-025.adoc[unordered&lowbar;set](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    xref:bsl/unordered_set-0d2d/size_type.adoc[size&lowbar;type] initialNumBuckets,
    HASH const& hashFunction,
    ALLOCATOR const& basicAllocator);
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-025.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified iterator range&period;


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

[.small]#xref:bsl/unordered_set-0d2d/2constructor-0b.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified `range`&period;


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

[.small]#xref:bsl/unordered_set-0d2d/2constructor-010.adoc[_» more&period;&period;&period;_]#

Create an unordered set 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_set-0d2d/2constructor-09.adoc[unordered&lowbar;set](
    std::initializer&lowbar;list&lt;KEY&gt; values,
    xref:bsl/unordered_set-0d2d/size_type.adoc[size&lowbar;type] initialNumBuckets = 0,
    HASH const& hashFunction = HASH(),
    EQUAL const& keyEqual = EQUAL(),
    ALLOCATOR const& basicAllocator = ALLOCATOR());
----

[.small]#xref:bsl/unordered_set-0d2d/2constructor-09.adoc[_» more&period;&period;&period;_]#

Create an unordered set from the specified iterator range&period;


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

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

Create an unordered set from the specified `range`&period;


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

[.small]#xref:bsl/unordered_set-0d2d/2constructor-02e.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *original*
| source unordered set
| *basicAllocator*
| allocator used to supply memory
| *initialNumBuckets*
| initial number of buckets
| *values*
| initializer list of values
| *hashFunction*
| hash function
| *first*
| the start of the iterator range
| *last*
| one past the end of the iterator range
| *tag*
| disambiguation tag for the range constructor
| *range*
| range of values to insert
| *keyEqual*
| key&hyphen;equality functor
|===


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