[#bsl-map-0af-try_emplace-0b]
= xref:bsl.adoc[bsl]::xref:bsl/map-0af.adoc[map&lt;TimeInterval, Node*&gt;]::try&lowbar;emplace
:relfileprefix: ../../
:mrdocs:

`try&lowbar;emplace` overloads

== Synopses

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

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/map-0af/try_emplace-02.adoc[try&lowbar;emplace](
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;TimeInterval&gt;] key,
    Args&&&period;&period;&period; args);
----

[.small]#xref:bsl/map-0af/try_emplace-02.adoc[_» more&period;&period;&period;_]#

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;


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

[.small]#xref:bsl/map-0af/try_emplace-0f.adoc[_» more&period;&period;&period;_]#

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 overload participates in overload resolution only when `LOOKUP&lowbar;KEY` is a transparent lookup key for `COMPARATOR`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class&period;&period;&period; Args&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/map-0af/try_emplace-09.adoc[try&lowbar;emplace](
    LOOKUP&lowbar;KEY&& key,
    Args&&&period;&period;&period; args)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   LOOKUP&lowbar;KEY&gt;&colon;&colon;value &amp;&amp;
        !bsl&colon;&colon;is&lowbar;convertible&lt;LOOKUP&lowbar;KEY&amp;&amp;, const&lowbar;iterator&gt;&colon;&colon;value &amp;&amp;
        !bsl&colon;&colon;is&lowbar;convertible&lt;LOOKUP&lowbar;KEY&amp;&amp;, iterator&gt;&colon;&colon;value;
----

[.small]#xref:bsl/map-0af/try_emplace-09.adoc[_» more&period;&period;&period;_]#

Insert at the specified `hint` using a movable `key` and the specified constructor `args`, or return an iterator to an existing entry&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
xref:bsl/map-0af/iterator.adoc[iterator]
xref:bsl/map-0af/try_emplace-06.adoc[try&lowbar;emplace](
    xref:bsl/map-0af/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;TimeInterval&gt;] key,
    Args&&&period;&period;&period; args);
----

[.small]#xref:bsl/map-0af/try_emplace-06.adoc[_» more&period;&period;&period;_]#

If a key equivalent to the specified `key` already exists in this map, return an iterator referring to the existing item&period; Otherwise, insert into this map a newly&hyphen;created `value&lowbar;type` object, constructed from from `key` and the specified `args`, and return an iterator referring to the newly&hyphen;created entry&period; Use the specified `hint` as a starting point for checking to see if the key already in the map&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;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; Args&gt;
xref:bsl/map-0af/iterator.adoc[iterator]
xref:bsl/map-0af/try_emplace-00.adoc[try&lowbar;emplace](
    xref:bsl/map-0af/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bsls/TimeInterval.adoc[TimeInterval] const& key,
    Args&&&period;&period;&period; args);
----

[.small]#xref:bsl/map-0af/try_emplace-00.adoc[_» more&period;&period;&period;_]#

Insert at the specified `hint` using the transparent `LOOKUP&lowbar;KEY` and the specified constructor `args`, or return an iterator to an existing entry&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class&period;&period;&period; Args&gt;
xref:bsl/map-0af/iterator.adoc[iterator]
xref:bsl/map-0af/try_emplace-01.adoc[try&lowbar;emplace](
    xref:bsl/map-0af/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& key,
    Args&&&period;&period;&period; args)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

[.small]#xref:bsl/map-0af/try_emplace-01.adoc[_» more&period;&period;&period;_]#


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