[#BloombergLP-bdlc-FlatHashMap-insert_or_assign-01] = 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 `key` using a hint. == Synopsis Declared in `<bdlc_flathashmap.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class MAPPED> xref:BloombergLP/bdlc/FlatHashMap/iterator.adoc[FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator] insert_or_assign( xref:BloombergLP/bdlc/FlatHashMap/const_iterator.adoc[const_iterator] hint, KEY const& key, MAPPED&& obj); ---- == 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. Otherwise, insert a new entry into the map. Return an iterator to the inserted or updated entry. `obj` is left in a (valid) unspecified state. == Return Value iterator to the inserted or updated element == Parameters [cols="1,4"] |=== | Name| Description | *hint* | iterator hint (ignored) | *key* | key to insert or update | *obj* | mapped value to assign or move‐insert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#