[#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;`

If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped&lowbar;type` of that entry, and return an iterator to that entry and `false`&period; Otherwise, insert a new entry into the map with the and return an iterator to that entry and `true`&period; `obj` is left in a (valid) unspecified state&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;_]#

If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped&lowbar;type` of that entry, and return an iterator to that entry and `false`&period; Otherwise, insert a new entry into the map with the and return an iterator to that entry and `true`&period; `obj` is left in a (valid) unspecified state&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;_]#

If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped&lowbar;type` of that entry, and return an iterator to that entry and `false`&period; Otherwise, insert a new entry into the map with the and return an iterator to that entry and `true`&period; `obj` is left in a (valid) unspecified state&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;_]#

If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped&lowbar;type` of that entry&period; Otherwise, insert a new entry into the map&period; Return an iterator to the inserted or updated entry&period; `obj` is left in a (valid) unspecified state&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],
    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;_]#

If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped&lowbar;type` of that entry&period; Otherwise, insert a new entry into the map&period; Return an iterator to the inserted or updated entry&period; `obj` is left in a (valid) unspecified state&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],
    KEY const& key,
    MAPPED&& obj);
----

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

If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped&lowbar;type` of that entry&period; Otherwise, insert a new entry into the map&period; Return an iterator to the inserted or updated entry&period; `obj` is left in a (valid) unspecified state&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],
    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;_]#


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