[#BloombergLP-bslstl-HashTable-insertIfMissing-00d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable.adoc[HashTable]::insertIfMissing
:relfileprefix: ../../../
:mrdocs:

`insertIfMissing` overloads

== Synopses

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

Insert a default&hyphen;mapped value for a movable `key` if missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/insertIfMissing-02.adoc[insertIfMissing](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;NonConstKeyType&gt;] key);
----

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

Insert a default&hyphen;mapped value for `key` if the key is missing&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/insertIfMissing-0548.adoc[insertIfMissing](xref:BloombergLP/bslstl/HashTable/KeyType.adoc[KeyType] const& key);
----

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

Insert a movable `value` if no equivalent key is present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/insertIfMissing-06.adoc[insertIfMissing](
    bool* isInsertedFlag,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;ValueType&gt;] value);
----

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

Insert `value` if no equivalent key is present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/insertIfMissing-0549.adoc[insertIfMissing](
    bool* isInsertedFlag,
    xref:BloombergLP/bslstl/HashTable/ValueType.adoc[ValueType] const& value);
----

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

Insert a value from `value` if no equivalent key is present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class SOURCE&lowbar;TYPE&gt;
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
xref:BloombergLP/bslstl/HashTable/insertIfMissing-005.adoc[insertIfMissing](
    bool* isInsertedFlag,
    SOURCE&lowbar;TYPE&& value);
----

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

== Return Value

* address of the element whose key is equivalent to `key`
* address of the (possibly newly inserted) element with an equivalent key

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| movable key used to find or insert an element
| *isInsertedFlag*
| set to `true` if a new entry was inserted
| *value*
| movable value to insert if missing
|===


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