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

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;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class MAPPED&gt;
xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[iterator]
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]#Created with https://www.mrdocs.com[MrDocs]#
