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

`insert` overloads

== Synopses

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

Insert `value` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator, bool&gt;]
xref:bsl/unordered_set-0d2d/insert-08.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;value&lowbar;type&gt;] value);
----

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

Insert each value from `values` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:bsl/unordered_set-0d2d/insert-0e.adoc[insert](std::initializer&lowbar;list&lt;KEY&gt; values);
----

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

Insert `value` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator, bool&gt;]
xref:bsl/unordered_set-0d2d/insert-01.adoc[insert](xref:bsl/unordered_set-0d2d/value_type.adoc[value&lowbar;type] const& value);
----

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

Insert `value` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/unordered_set-0d2d/insert-074c.adoc[insert](LOOKUP&lowbar;KEY&& value)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
        &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

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

Insert `value` using `hint` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/iterator.adoc[unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator]
xref:bsl/unordered_set-0d2d/insert-0740.adoc[insert](
    xref:bsl/unordered_set-0d2d/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;value&lowbar;type&gt;] value);
----

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

Insert `value` using `hint` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/iterator.adoc[unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator]
xref:bsl/unordered_set-0d2d/insert-06.adoc[insert](
    xref:bsl/unordered_set-0d2d/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:bsl/unordered_set-0d2d/value_type.adoc[value&lowbar;type] const& value);
----

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

Insert `value` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
void
xref:bsl/unordered_set-0d2d/insert-0f.adoc[insert](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last);
----

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

Insert `value` using `hint` if its key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/unordered_set-0d2d/iterator.adoc[iterator]
xref:bsl/unordered_set-0d2d/insert-03.adoc[insert](
    xref:bsl/unordered_set-0d2d/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& value)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
        &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value
        &amp;&amp; !bsl&colon;&colon;is&lowbar;convertible&lt;LOOKUP&lowbar;KEY&amp;&amp;, iterator&gt;&colon;&colon;value
        &amp;&amp; !bsl&colon;&colon;is&lowbar;convertible&lt;LOOKUP&lowbar;KEY&amp;&amp;, const&lowbar;iterator&gt;&colon;&colon;value;
----

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

== Return Value

* iterator to the element and whether insertion occurred
* iterator to the existing or newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| value to insert
| *values*
| initializer list of values
| *hint*
| position hint for insertion
| *first*
| beginning of the range of values to insert
| *last*
| end of the range of values to insert (one past last)
|===


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