[#BloombergLP-bslstl-HashTable-tryEmplace-0b] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable.adoc[HashTable]::tryEmplace :relfileprefix: ../../../ :mrdocs: Emplace a value for a transparent `key` if missing; otherwise return existing. == Synopsis Declared in `<bslstl_hashtable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class LOOKUP_KEY, class... ARGS> xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* tryEmplace( bool* isInsertedFlag, xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* hint, LOOKUP_KEY&& key, ARGS&&... args) requires BloombergLP::bslmf::IsTransparentPredicate<HASHER, LOOKUP_KEY>::value && BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR,LOOKUP_KEY>::value; ---- == Description If a key equivalent to the specified `key` already exists in this hash‐table, load `false` into the specified `isInsertedFlag` and return a pointer to the existing entry. Otherwise, insert into this hash‐table a newly‐created `value_type` object, constructed from `key` and the specified `args`, load `true` into `isInsertedFlag` and return a pointer to the newly created entry. Use the optionally specified `hint` as a starting place for the search for the existing key. == Return Value pointer to the existing or newly created entry == Parameters [cols="1,4"] |=== | Name| Description | *isInsertedFlag* | set to `true` if a new entry was inserted | *hint* | optional starting node for the key search | *key* | transparent key used to find or insert an entry | *args* | arguments used to construct the mapped value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#