[#bsl-map-0a7-try_emplace-0be]
= xref:bsl.adoc[bsl]::xref:bsl/map-0a7.adoc[map]::try&lowbar;emplace
:relfileprefix: ../../
:mrdocs:

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`&period; Otherwise, insert into this map a newly&hyphen;created entry constructed from `key` and the specified `args`, and return a pair containing an iterator referring to the newly&hyphen;created entry and `true`&period; This method requires that the (template parameter) types `KEY` and `VALUE` are `emplace&hyphen;constructible` from `key` and `args` respectively&period; For C&plus;&plus;03, `VALUE` must also be `copy&hyphen;constructible`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;map&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
xref:bsl/pair-0b.adoc[pair&lt;map&lt;KEY, VALUE, COMPARATOR, ALLOCATOR&gt;::iterator, bool&gt;]
try&lowbar;emplace(
    KEY const& key,
    Args&&&period;&period;&period; args);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
