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

`insert&lowbar;or&lowbar;assign` overloads

== Synopses

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

Insert or assign the specified `obj` under the specified movable `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/unordered_map-02b/insert_or_assign-0bf.adoc[insert&lowbar;or&lowbar;assign](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;KEY&gt;] key,
    BDE&lowbar;OTHER&lowbar;TYPE&& obj);
----

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

Insert or assign `obj` under the specified `key`&period;


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

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

Insert or assign `obj` under transparent `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/unordered_map-02b/insert_or_assign-0b9.adoc[insert&lowbar;or&lowbar;assign](
    LOOKUP&lowbar;KEY&& key,
    BDE&lowbar;OTHER&lowbar;TYPE&& obj)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
         &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

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

Insert or assign `obj` under movable `key` at `hint`&period;


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

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

Insert or assign `obj` under `key` at `hint`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:bsl/unordered_map-02b/iterator.adoc[iterator]
xref:bsl/unordered_map-02b/insert_or_assign-062.adoc[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]#xref:bsl/unordered_map-02b/insert_or_assign-062.adoc[_» more&period;&period;&period;_]#

Insert or assign `obj` under transparent `key` at `hint`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:bsl/unordered_map-02b/iterator.adoc[iterator]
xref:bsl/unordered_map-02b/insert_or_assign-0db.adoc[insert&lowbar;or&lowbar;assign](
    xref:bsl/unordered_map-02b/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& key,
    BDE&lowbar;OTHER&lowbar;TYPE&& obj)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASH, LOOKUP&lowbar;KEY&gt;&colon;&colon;value
         &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;EQUAL,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

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

== Return Value

* iterator to the element and whether insertion occurred
* iterator to the element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to insert or assign under
| *obj*
| mapped value to insert or assign
| *hint*
| iterator hint for insertion
|===


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