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

Try to emplace an element with a movable `key`&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(
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;KEY&gt;] key,
    Args&&&period;&period;&period; args);
----

== Description

Same as the preceding `try&lowbar;emplace` overload, for movable keys&period;

== Return Value

pair of iterator and whether a new element was inserted

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| key to move into the new element
| *args*
| constructor arguments for the mapped value
|===


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