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

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

== Synopsis

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

[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;]
insert&lowbar;or&lowbar;assign(
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;KEY&gt;] key,
    M&& obj);
----

== Description

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;

== Return Value

pair of iterator to the element and `true` if inserted

== 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
|===


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