BloombergLP::bdlc::FlatHashMap::insert_or_assign

Insert or assign the mapped value for key using a hint.

Synopsis

Declared in <bdlc_flathashmap.h>

template<class MAPPED>
FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
insert_or_assign(
    const_iterator hint,
    BloombergLP::bslmf::MovableRef<KEY> 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

NameDescription
hintiterator hint (ignored)
keykey to insert or update (may be moved from)
objmapped value to assign or move-insert