[#bsl-unordered_map-02b-insert-06]
= xref:bsl.adoc[bsl]::xref:bsl/unordered_map-02b.adoc[unordered&lowbar;map]::insert
:relfileprefix: ../../
:mrdocs:

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

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALT&lowbar;VALUE&lowbar;TYPE&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
insert(ALT&lowbar;VALUE&lowbar;TYPE&& value)
requires std&colon;&colon;is&lowbar;constructible&lt;value&lowbar;type,
                                             ALT&lowbar;VALUE&lowbar;TYPE&amp;&amp;&gt;&colon;&colon;value;
----

== Description

Insert the specified `value` into this unordered map if the key (the `first` element) of the object referred to by `value` does not already exist in this unordered map&semi; otherwise, this method has no effect (a `value&lowbar;type` object having the same key as the converted `value` already exists in this unordered map) &period; Return a `pair` whose `first` member is an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this unordered map whose key is the equivalent to that of the object to be inserted, and whose `second` member is `true` if a new value was inserted, and `false` if a value having an equivalent key was already present&period; Note that this method requires that the (template parameter) types `KEY` and `VALUE` both be `move&hyphen;constructible` (see &lcub;Requirements on `value&lowbar;type`&rcub;), and that the `value&lowbar;type` be constructible from the (template parameter) `ALT&lowbar;VALUE&lowbar;TYPE`&period; Also note that this one template stands in for three `insert` functions in the C&plus;&plus;11 standard&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]#
