[#bsl-set-0d-insert-00a]
= xref:bsl.adoc[bsl]::xref:bsl/set-0d.adoc[set]::insert
:relfileprefix: ../../
:mrdocs:

`insert` overloads

== Synopses

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

Move&hyphen;insert `value` if an equivalent key is not already present&period;


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

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

Insert each unique value from the `values` initializer list&period;


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

[.small]#xref:bsl/set-0d/insert-0a.adoc[_» more&period;&period;&period;_]#

Insert `value` if an equivalent key is not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[pair&lt;set&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator, bool&gt;]
xref:bsl/set-0d/insert-06e.adoc[insert](xref:bsl/set-0d/value_type.adoc[value&lowbar;type] const& value);
----

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

Insert a transparent `value` if an equivalent key is not present&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/set-0d/insert-00c.adoc[insert](LOOKUP&lowbar;KEY&& value)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

[.small]#xref:bsl/set-0d/insert-00c.adoc[_» more&period;&period;&period;_]#

Move&hyphen;insert `value` near `hint` if an equivalent key is not present&period;


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

[.small]#xref:bsl/set-0d/insert-058.adoc[_» more&period;&period;&period;_]#

Insert `value` near `hint` if an equivalent key is not present&period;


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

[.small]#xref:bsl/set-0d/insert-060.adoc[_» more&period;&period;&period;_]#

Insert each unique value from the range `&lsqb;first &period;&period; last)&rsqb;`&period;


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

[.small]#xref:bsl/set-0d/insert-050.adoc[_» more&period;&period;&period;_]#

Insert a transparent `value` near `hint` if not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/set-0d/iterator.adoc[iterator]
xref:bsl/set-0d/insert-0e.adoc[insert](
    xref:bsl/set-0d/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& value)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   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/set-0d/insert-0e.adoc[_» more&period;&period;&period;_]#

== Return Value

* pair of iterator and whether a new element was inserted
* iterator to the existing or newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| key to move&hyphen;insert
| *values*
| initializer list of keys to insert
| *hint*
| iterator hint for insertion position
| *first*
| beginning of the range (inclusive)
| *last*
| end of the range (exclusive)
|===


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