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

Insert `value` 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/pair-0b.adoc[bsl::pair&lt;unordered&lowbar;set&lt;KEY, HASH, EQUAL, ALLOCATOR&gt;::iterator, bool&gt;]
insert(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 a pair whose `first` member is an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this set that is equivalent to `value`, and whose `second` member is `true` if a new value was inserted, and `false` if the key was already present&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` (see &lcub;Requirements on `KEY`&rcub;)&period;

== Return Value

iterator to the element and whether insertion occurred

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| value to insert
|===


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