[#BloombergLP-bslstl-HashTable-09-insertIfMissing-09]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable-09.adoc[HashTable&lt;UnorderedMapKeyConfiguration&lt;basic&lowbar;string&lt;char&gt; const, pair&lt;basic&lowbar;string&lt;char&gt; const, Json&gt;&gt;, TransparentHash, TransparentEqualTo, allocator&lt;pair&lt;basic&lowbar;string&lt;char&gt; const, Json&gt;&gt;&gt;]::insertIfMissing
:relfileprefix: ../../../
:mrdocs:

`insertIfMissing` overloads

== Synopses

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

Same as the `insertIfMissing` overload taking `const KeyType&amp;`&period;


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

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

Insert into this hash&hyphen;table a newly&hyphen;created `ValueType` object, constructed by forwarding the specified `key` and a default&hyphen;constructed object of the type `ValueType&colon;&colon;second&lowbar;type`, to the corresponding constructor of `ValueType`, if `key` does not already exist in this hash&hyphen;table&period; Return the address of the (possibly newly created and inserted) element in this hash&hyphen;table whose key is equivalent to `key`&period; If this hash&hyphen;table contains more than one element with the supplied `key`, return the first such element (from the contiguous sequence of elements having a matching key)&period; Additional buckets are allocated, as needed, to preserve the invariant `loadFactor &lt;&equals; maxLoadFactor`&period; If this function tries to allocate a number of buckets larger than can be represented by this hash table&apos;s `SizeType`, a `std&colon;&colon;length&lowbar;error` exception is thrown&period; This method requires that the `ValueType` defined in the (template parameter) type `KEY&lowbar;CONFIG` be `emplace&hyphen;constructible` into this hash&hyphen;table from a `pair` of arguments representing the key and value, respectively (see &lcub;Requirements on `KEY&lowbar;CONFIG`&rcub;)&semi;


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

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

Insert the specified `value` into this hash&hyphen;table if a key equivalent to that of `value` does not already exist in this hash&hyphen;table&period; Return the address of the (possibly newly inserted) element in this hash&hyphen;table whose key is equivalent to that of `value`&period; `value` is left in a valid but unspecified state&period; If this hash&hyphen;table contains more than one element with a matching key, return the first such element (from the contiguous sequence of elements having a matching key)&period; Additional buckets are allocated, as needed, to preserve the invariant `loadFactor &lt;&equals; maxLoadFactor`&period; If this function tries to allocate a number of buckets larger than can be represented by this hash&hyphen;table&apos;s `SizeType`, a `std&colon;&colon;length&lowbar;error` exception is thrown&period; This method requires that the `ValueType` defined in the (template parameter) type `KEY&lowbar;CONFIG` be `move&hyphen;insertable` into this hash&hyphen;table (see &lcub;Requirements on `KEY&lowbar;CONFIG`&rcub;)&semi;


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

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

Insert the specified `value` into this hash&hyphen;table if a key equivalent to that of `value` does not already exist in this hash&hyphen;table&period; Return the address of the (possibly newly inserted) element in this hash&hyphen;table whose key is equivalent to that of `value`&period; If this hash&hyphen;table contains more than one element with a matching key, return the first such element (from the contiguous sequence of elements having a matching key)&period; Additional buckets are allocated, as needed, to preserve the invariant `loadFactor &lt;&equals; maxLoadFactor`&period; If this function tries to allocate a number of buckets larger than can be represented by this hash&hyphen;table&apos;s `SizeType`, a `std&colon;&colon;length&lowbar;error` exception is thrown&period; This method requires that the `ValueType` defined in the (template parameter) type `KEY&lowbar;CONFIG` be `copy&hyphen;insertable` into this hash&hyphen;table (see &lcub;Requirements on `KEY&lowbar;CONFIG`&rcub;)&semi;


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

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

Insert into this hash&hyphen;table a `ValueType` object created from the specified `value` if a key equivalent to that of such an object does not already exist in this hash&hyphen;table&period; Return the address of the (possibly newly inserted) element in this hash&hyphen;table whose key is equivalent to that of the object created from `value`&period; Load `true` into the specified `isInsertedFlag` if a new value was inserted, and `false` if an equivalent key was already present&period; If this hash&hyphen;table contains more than one element with an equivalent key, return the first such element (from the contiguous sequence of elements having a matching key)&period; Additional buckets are allocated, as needed, to preserve the invariant `loadFactor &lt;&equals; maxLoadFactor`&period; If this function tries to allocate a number of buckets larger than can be represented by this hash&hyphen;table&apos;s `SizeType`, a `std&colon;&colon;length&lowbar;error` exception is thrown&period; This method requires that the `ValueType` defined in the (template parameter) type `KEY&lowbar;CONFIG` be `move&hyphen;insertable` into this hash&hyphen;table (see &lcub;Requirements on `KEY&lowbar;CONFIG`&rcub;) and the (template parameter) type `SOURCE&lowbar;TYPE` be implicitly convertible to `ValueType`&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-09/insertIfMissing-06.adoc[insertIfMissing](
    bool* isInsertedFlag,
    SOURCE&lowbar;TYPE&& value);
----

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


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