Insert a newly constructed entry for key unless an equivalent key exists.
Synopses
Declared in <bdlc_flathashtable.h>
Insert a newly constructed entry for key unless an equivalent key exists.
template<class... ARGS>
bsl::pair<FlatHashTable<KEY, ENTRY, ENTRY_UTIL, HASH, EQUAL>::iterator, bool>
try_emplace(
BloombergLP::bslmf::MovableRef<KEY> key,
ARGS&&... args);
Insert a newly constructed entry for key unless an equivalent key exists.
template<class... ARGS>
bsl::pair<FlatHashTable<KEY, ENTRY, ENTRY_UTIL, HASH, EQUAL>::iterator, bool>
try_emplace(
KEY const& key,
ARGS&&... args);
Insert a newly constructed entry for key unless an equivalent key exists.
template<
class LOOKUP_KEY,
class... ARGS>
bsl::pair<iterator, bool>
try_emplace(
LOOKUP_KEY&& key,
ARGS&&... args)
requires BloombergLP::bslmf::IsTransparentPredicate<HASH, LOOKUP_KEY>::value
&& BloombergLP::bslmf::IsTransparentPredicate<EQUAL,LOOKUP_KEY>::value;
Return Value
pair of iterator to the entry and true if inserted
Parameters
Name |
Description |
key |
key used to find or construct the entry |
args |
arguments forwarded to construct the mapped value |
Created with MrDocs