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

`insert` overloads

== Synopses

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

Insert each element of `values` whose key is not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:bsl/unordered_map-02b/insert-04.adoc[insert](std::initializer&lowbar;list&lt;value&lowbar;type&gt; values);
----

[.small]#xref:bsl/unordered_map-02b/insert-04.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/unordered_map-02b/insert-028.adoc[insert](xref:bsl/unordered_map-02b/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:bsl/unordered_map-02b/insert-028.adoc[_» more&period;&period;&period;_]#

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


[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;]
xref:bsl/unordered_map-02b/insert-06.adoc[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;
----

[.small]#xref:bsl/unordered_map-02b/insert-06.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/unordered_map-02b/iterator.adoc[iterator]
xref:bsl/unordered_map-02b/insert-08.adoc[insert](
    xref:bsl/unordered_map-02b/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:bsl/unordered_map-02b/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:bsl/unordered_map-02b/insert-08.adoc[_» more&period;&period;&period;_]#

Insert each element in `&lsqb;first, last)&rsqb;` whose key is not already present&period;


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

[.small]#xref:bsl/unordered_map-02b/insert-0b.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALT&lowbar;VALUE&lowbar;TYPE&gt;
xref:bsl/unordered_map-02b/iterator.adoc[iterator]
xref:bsl/unordered_map-02b/insert-021.adoc[insert](
    xref:bsl/unordered_map-02b/const_iterator.adoc[const&lowbar;iterator] hint,
    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;
----

[.small]#xref:bsl/unordered_map-02b/insert-021.adoc[_» more&period;&period;&period;_]#

== Return Value

* iterator to the element and whether insertion occurred
* iterator to the existing or newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *values*
| initializer list of values to insert
| *value*
| value to insert
| *hint*
| iterator hint for insertion
| *first*
| start of the range
| *last*
| end of the range (one past last)
|===


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