insert_or_assign overloads

Synopses

Declared in <bdlc_flathashmap.h>

Insert or assign the mapped value for the specified key.

Insert or assign the mapped value for the specified key.

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;

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

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);

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;

Return Value

  • pair of iterator to the element and true if inserted

  • iterator to the inserted or updated element

Parameters

Name

Description

key

key to insert or update (may be moved from)

obj

mapped value to assign or move‐insert

hint

iterator hint (ignored)

Created with MrDocs