If a key equivalent to the specified key already exists in this map, return a pair containing an iterator referring to the existing item and false. Otherwise, insert into this map a newly‐created entry constructed from key and the specified args, and return a pair containing an iterator referring to the newly‐created entry and true. This overload participates in overload resolution only when LOOKUP_KEY is a transparent lookup key for COMPARATOR.

Synopsis

Declared in <bslstl_map.h>

template<
    class LOOKUP_KEY,
    class... Args>
pair<iterator, bool>
try_emplace(
    LOOKUP_KEY&& key,
    Args&&... args)
requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,
                                                   LOOKUP_KEY>::value &&
        !bsl::is_convertible<LOOKUP_KEY&&, const_iterator>::value &&
        !bsl::is_convertible<LOOKUP_KEY&&, iterator>::value;

Created with MrDocs