[#bsl-map-0a7-insert-07]
= xref:bsl.adoc[bsl]::xref:bsl/map-0a7.adoc[map]::insert
:relfileprefix: ../../
:mrdocs:

Insert a movable `value` if its key is absent&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[pair&lt;map&lt;KEY, VALUE, COMPARATOR, ALLOCATOR&gt;::iterator, bool&gt;]
insert(xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;value&lowbar;type&gt;] value);
----

== Description

Insert into this map the specified `value` if a key (the `first` element) equivalent to that of `value` does not already exist in this map&semi; otherwise, this method has no effect&period; Return a pair whose `first` member is an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this map whose key is equivalent to that of `value`, and whose `second` member is `true` if a new value was inserted and `false` if the key was already present&period; This method requires that the (template parameter) types `KEY` and `VALUE` both be `move&hyphen;insertable` into this map (see &lcub;Requirements on `KEY` and `VALUE`&rcub;)&period;

== Return Value

pair of iterator and whether a new element was inserted

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| element to move&hyphen;insert
|===


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