[#BloombergLP-bslstl-HashTable-tryEmplace-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable.adoc[HashTable]::tryEmplace
:relfileprefix: ../../../
:mrdocs:

`tryEmplace` overloads

== Synopses

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

Emplace a value for a movable `key` if missing&semi; otherwise return existing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; ARGS&gt;
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/tryEmplace-09.adoc[tryEmplace](
    bool* isInsertedFlag,
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;NonConstKeyType&gt;] key,
    ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/HashTable/tryEmplace-09.adoc[_» more&period;&period;&period;_]#

Emplace a value for `key` if missing&semi; otherwise return the existing entry&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; ARGS&gt;
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/tryEmplace-00.adoc[tryEmplace](
    bool* isInsertedFlag,
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* hint,
    xref:BloombergLP/bslstl/HashTable/KeyType.adoc[KeyType] const& key,
    ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/HashTable/tryEmplace-00.adoc[_» more&period;&period;&period;_]#

Emplace a value for a transparent `key` if missing&semi; otherwise return existing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class&period;&period;&period; ARGS&gt;
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/tryEmplace-0b.adoc[tryEmplace](
    bool* isInsertedFlag,
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* hint,
    LOOKUP&lowbar;KEY&& key,
    ARGS&&&period;&period;&period; args)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;HASHER,    LOOKUP&lowbar;KEY&gt;&colon;&colon;value
   &amp;&amp; BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bslstl/HashTable/tryEmplace-0b.adoc[_» more&period;&period;&period;_]#

== 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*
| movable key used to find or insert an entry
| *args*
| arguments used to construct the mapped value
|===


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