[#bsl-map-0a7-try_emplace-04] = xref:bsl.adoc[bsl]::xref:bsl/map-0a7.adoc[map]::try_emplace :relfileprefix: ../../ :mrdocs: Try to emplace an element with transparent `key` near `hint`. == Synopsis Declared in `<bslstl_map.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class LOOKUP_KEY, class... Args> xref:bsl/map-0a7/iterator.adoc[iterator] try_emplace( xref:bsl/map-0a7/const_iterator.adoc[const_iterator] hint, LOOKUP_KEY&& key, Args&&... args) requires BloombergLP::bslmf::IsTransparentPredicate<COMPARATOR, LOOKUP_KEY>::value; ---- == Description Insert at the specified `hint` using the transparent `LOOKUP_KEY` and the specified constructor `args`, or return an iterator to an existing entry. == Return Value iterator to the existing or newly inserted element == Parameters [cols="1,4"] |=== | Name| Description | *hint* | iterator hint for the insertion position | *key* | transparent key for the element to emplace | *args* | constructor arguments for the mapped value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#