[#BloombergLP-bdlc-FlatHashMap-insert_or_assign-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/FlatHashMap.adoc[FlatHashMap]::insert_or_assign :relfileprefix: ../../../ :mrdocs: Insert or assign the mapped value for the specified `key`. == Synopsis Declared in `<bdlc_flathashmap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class LOOKUP_KEY, class M> xref:bsl/pair-0b.adoc[bsl::pair<iterator, bool>] insert_or_assign( LOOKUP_KEY&& key, M&& obj) requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value; ---- == Description If this map contains an entry with a key equivalent to the specified `key`, assign the specified `obj` to the `mapped_type` of that entry, and return an iterator to that entry and `false`. Otherwise, insert a new entry into the map with the and return an iterator to that entry and `true`. `obj` is left in a (valid) unspecified state. == Return Value pair of iterator to the element and `true` if inserted == Parameters [cols="1,4"] |=== | Name| Description | *key* | transparent key to insert or update | *obj* | mapped value to assign or move‐insert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#