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

Insert or assign a mapped value for a transparent `key`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]*
insertOrAssignTransparent(
    bool* isInsertedFlag,
    xref:BloombergLP/bslalg/BidirectionalLink.adoc[bslalg::BidirectionalLink]* hint,
    LOOKUP&lowbar;KEY&& key,
    BDE&lowbar;OTHER&lowbar;TYPE&& obj)
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;
----

== Description

If a key equivalent to the specified `key` already exists in this hash&hyphen;table, assign the specified `obj` to the value associated with that key, load `false` into the specified `isInsertedFlag` and return a pointer to the existing entry&period; Otherwise, insert into this hash&hyphen;table a newly&hyphen;created `value&lowbar;type` object, constructed from `key` and `obj`, load `true` into `isInsertedFlag`, and return a pointer to the newly&hyphen;created entry&period; Use the optionally specified `hint` as a starting place for the search for the existing key&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*
| transparent key to insert or assign
| *obj*
| mapped value to insert or assign
|===


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