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

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

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;

Return Value

pointer to the existing or newly created entry

Parameters

Name

Description

isInsertedFlag

set to true if a new entry was inserted

hint

optional starting node for the key search

key

movable key used to find or insert an entry

args

arguments used to construct the mapped value

Created with MrDocs