BloombergLP::bdlc::FlatHashMap::insert_or_assign

insert_or_assign overloads

Synopses

Declared in <bdlc_flathashmap.h>

Insert or assign the mapped value for the specified key.

template<class M>
bsl::pair<FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator, bool>
insert_or_assign(
    BloombergLP::bslmf::MovableRef<KEY> key,
    M&& obj);
» more...

Insert or assign the mapped value for the specified key.

template<class M>
bsl::pair<FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator, bool>
insert_or_assign(
    KEY const& key,
    M&& obj);
» more...

Insert or assign the mapped value for the specified key.

template<
    class LOOKUP_KEY,
    class M>
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;
» more...

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

template<class MAPPED>
FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
insert_or_assign(
    const_iterator hint,
    BloombergLP::bslmf::MovableRef<KEY> key,
    MAPPED&& obj);
» more...

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

template<class MAPPED>
FlatHashMap<KEY, VALUE, HASH, EQUAL>::iterator
insert_or_assign(
    const_iterator hint,
    KEY const& key,
    MAPPED&& obj);
» more...

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

template<
    class LOOKUP_KEY,
    class MAPPED>
iterator
insert_or_assign(
    const_iterator hint,
    LOOKUP_KEY&& key,
    MAPPED&& obj)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
         && BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;
» more...

Return Value

  • pair of iterator to the element and true if inserted
  • iterator to the inserted or updated element

Parameters

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