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

If a key equivalent to the specified `key` already exists in this unordered&lowbar;map, assign the specified `obj` to the value associated with that key, and return an iterator referring to the existing item&period; Otherwise, insert into this map a newly&hyphen;created `value&lowbar;type` object, constructed from `(std&colon;&colon;forward&lt;KEY&gt;(key), std&colon;&colon;forward&lt;BDE&lowbar;OTHER&lowbar;TYPE&gt;(obj)&period;&period;&period;))`, and return a pair containing an iterator referring to the newly&hyphen;created entry and `true`&period; Use the specified `hint` as a starting point for checking to see if the key already in the unordered&lowbar;map&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:bsl/unordered_map-02b/iterator.adoc[iterator]
insert&lowbar;or&lowbar;assign(
    xref:bsl/unordered_map-02b/const_iterator.adoc[const&lowbar;iterator] hint,
    KEY const& key,
    BDE&lowbar;OTHER&lowbar;TYPE&& obj);
----


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