[#bsl-map-0c7-insert_or_assign-00]
= xref:bsl.adoc[bsl]::xref:bsl/map-0c7.adoc[map&lt;int, pair&lt;shared&lowbar;ptr&lt;Statistics&gt;, shared&lowbar;ptr&lt;Collector&lt;OsLinux&gt;&gt;&gt;&gt;]::insert&lowbar;or&lowbar;assign
:relfileprefix: ../../
:mrdocs:

If a key equivalent to the specified `key` already exists in this &lowbar;map, assign the specified obj to the value associated with that key, and return an iterator referring to the existing item&period; Otherwise, insert into this map a newly&hyphen;created `value&lowbar;type` object constructed from `(std&colon;&colon;forward&lt;KEY&gt;(key), std&colon;&colon;forward&lt;BDE&lowbar;OTHER&lowbar;TYPE&gt;(obj)&period;&period;&period;))`, 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;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class LOOKUP&lowbar;KEY,
    class BDE&lowbar;OTHER&lowbar;TYPE&gt;
xref:bsl/map-0c7/iterator.adoc[iterator]
insert&lowbar;or&lowbar;assign(
    xref:bsl/map-0c7/const_iterator.adoc[const&lowbar;iterator] hint,
    LOOKUP&lowbar;KEY&& key,
    BDE&lowbar;OTHER&lowbar;TYPE&& obj)
requires BloombergLP&colon;&colon;bslmf&colon;&colon;IsTransparentPredicate&lt;COMPARATOR,
                                                   LOOKUP&lowbar;KEY&gt;&colon;&colon;value;
----


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