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

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_set-0d2d/iterator.adoc[unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator]
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);
----

== Description

Insert the specified `value` into this set if a key equivalent to `value` does not already exist in this set&semi; otherwise, if a key equivalent to `value` already exists in this set, this method has no effect&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 `copy&hyphen;constructible` into this set (see &lcub;Requirements on `KEY`&rcub;)&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;

== Return Value

iterator to the existing or newly inserted element

== Parameters

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


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