[#BloombergLP-bdlc-FlatHashMap-insert_or_assign-0f]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::insert&lowbar;or&lowbar;assign
:relfileprefix: ../../../
:mrdocs:

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

== Synopses

Declared in `&lt;bdlc&lowbar;flathashmap&period;h&gt;`

Insert or assign the mapped value for the specified `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class M&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-05.adoc[insert&lowbar;or&lowbar;assign](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;KEY&gt;] key,
    M&& obj);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-05.adoc[_» more&period;&period;&period;_]#

Insert or assign the mapped value for the specified `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class M&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-02.adoc[insert&lowbar;or&lowbar;assign](
    KEY const& key,
    M&& obj);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-02.adoc[_» more&period;&period;&period;_]#

Insert or assign the mapped value for the specified `key`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class M&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;iterator, bool&gt;]
xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-0a.adoc[insert&lowbar;or&lowbar;assign](
    LOOKUP&lowbar;KEY&& key,
    M&& 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:BloombergLP/bdlc/FlatHashMap/insert_or_assign-0a.adoc[_» more&period;&period;&period;_]#

Insert or assign the mapped value for `key` using a hint&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class MAPPED&gt;
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator]
xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-03.adoc[insert&lowbar;or&lowbar;assign](
    xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;KEY&gt;] key,
    MAPPED&& obj);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-03.adoc[_» more&period;&period;&period;_]#

Insert or assign the mapped value for `key` using a hint&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class MAPPED&gt;
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap&lt;KEY, VALUE, HASH, EQUAL&gt;::iterator]
xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-01.adoc[insert&lowbar;or&lowbar;assign](
    xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator] hint,
    KEY const& key,
    MAPPED&& obj);
----

[.small]#xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-01.adoc[_» more&period;&period;&period;_]#

Insert or assign the mapped value for `key` using a hint&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class MAPPED&gt;
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[iterator]
xref:BloombergLP/bdlc/FlatHashMap/insert_or_assign-06.adoc[insert&lowbar;or&lowbar;assign](
    xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& key,
    MAPPED&& 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:BloombergLP/bdlc/FlatHashMap/insert_or_assign-06.adoc[_» more&period;&period;&period;_]#

== Return Value

* pair of iterator to the element and `true` if inserted
* iterator to the inserted or updated element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to insert or update (may be moved from)
| *obj*
| mapped value to assign or move&hyphen;insert
| *hint*
| iterator hint (ignored)
|===


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