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

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class LOOKUP&lowbar;KEY&gt;
xref:bsl/set-0d/iterator.adoc[iterator]
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;
----

== Description

`value` is left in a valid but unspecified state&period; Return an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this set that is equivalent to `value`&period; The average and worst case complexity of this operation is not affected by the specified `hint`&period; This method requires that the (template parameter) type `KEY` be `move&hyphen;insertable` (see &lcub;Requirements on `KEY`&rcub;) into this set&period; The behavior is undefined unless `hint` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included)&period; Note that `hint` is ignored (other than possibly asserting its validity in some build modes)&period;

Note&colon; implemented inline due to Sun CC compilation error&period;

== Return Value

iterator to the existing or newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *hint*
| iterator hint for insertion position
| *value*
| key to insert
|===


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