BloombergLP::bslstl::HashTable::tryEmplace

tryEmplace overloads

Synopses

Declared in <bslstl_hashtable.h>

Emplace a value for a movable key if missing; otherwise return existing.

template<class... ARGS>
bslalg::BidirectionalLink*
tryEmplace(
    bool* isInsertedFlag,
    bslalg::BidirectionalLink* hint,
    bslmf::MovableRef<NonConstKeyType> key,
    ARGS&&... args);
» more...

Emplace a value for key if missing; otherwise return the existing entry.

template<class... ARGS>
bslalg::BidirectionalLink*
tryEmplace(
    bool* isInsertedFlag,
    bslalg::BidirectionalLink* hint,
    KeyType const& key,
    ARGS&&... args);
» more...

Emplace a value for a transparent key if missing; otherwise return existing.

template<
    class LOOKUP_KEY,
    class... ARGS>
bslalg::BidirectionalLink*
tryEmplace(
    bool* isInsertedFlag,
    bslalg::BidirectionalLink* hint,
    LOOKUP_KEY&& key,
    ARGS&&... args)
requires BloombergLP::bslmf::IsTransparentPredicate<HASHER,    LOOKUP_KEY>::value
   && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value;
» more...

Return Value

pointer to the existing or newly created entry

Parameters

NameDescription
isInsertedFlagset to true if a new entry was inserted
hintoptional starting node for the key search
keymovable key used to find or insert an entry
argsarguments used to construct the mapped value