[#bsl-map-0af-insert-02]
= xref:bsl.adoc[bsl]::xref:bsl/map-0af.adoc[map&lt;TimeInterval, Node*&gt;]::insert
:relfileprefix: ../../
:mrdocs:

`insert` overloads

== Synopses

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

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;


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

[.small]#xref:bsl/map-0af/insert-03c.adoc[_» more&period;&period;&period;_]#

Insert into this map the value of each `value&lowbar;type` object in the specified `values` initializer list if a key equivalent to that of the object is not already contained in this map&period; This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy&hyphen;insertable` into this map (see &lcub;Requirements on `KEY` and `VALUE`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:bsl/map-0af/insert-08.adoc[insert](std::initializer&lowbar;list&lt;value&lowbar;type&gt; values);
----

[.small]#xref:bsl/map-0af/insert-08.adoc[_» more&period;&period;&period;_]#

Insert the specified `value` into this map if a key (the `first` element) equivalent to that of `value` does not already exist in this map&semi; otherwise, if a `value&lowbar;type` object whose key is equivalent to that of `value` already exists in this map, 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 `copy&hyphen;insertable` into this map (see &lcub;Requirements on `KEY` and `VALUE`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/map-0af/insert-0d5.adoc[insert](xref:bsl/map-0af/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:bsl/map-0af/insert-0d5.adoc[_» more&period;&period;&period;_]#

Insert into this map a `value&lowbar;type` object created from the specified `value` if a key (the `first` element) equivalent to that of such an object does not already exist in this map&semi; otherwise, this method has no effect (other than possibly creating a temporary `value&lowbar;type` object)&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 the object created from `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;), and the `value&lowbar;type` be constructible from the (template parameter) `ALT&lowbar;VALUE&lowbar;TYPE`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALT&lowbar;VALUE&lowbar;TYPE&gt;
xref:bsl/pair-0b.adoc[pair&lt;iterator, bool&gt;]
xref:bsl/map-0af/insert-034.adoc[insert](ALT&lowbar;VALUE&lowbar;TYPE&& value)
requires std&colon;&colon;is&lowbar;constructible&lt;value&lowbar;type,
                                             ALT&lowbar;VALUE&lowbar;TYPE&amp;&amp;&gt;&colon;&colon;value;
----

[.small]#xref:bsl/map-0af/insert-034.adoc[_» more&period;&period;&period;_]#

Insert into this map the specified `value` (in amortized constant time if the specified `hint` is a valid immediate successor to `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 an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this map whose key is equivalent to that of `value`&period; If `hint` is not a valid immediate successor to `value`, this operation has `O&lsqb;log(N)&rsqb;` complexity, where `N` is the size of this map&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; The behavior is undefined unless `hint` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/map-0af/iterator.adoc[iterator]
xref:bsl/map-0af/insert-060.adoc[insert](
    xref:bsl/map-0af/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;value&lowbar;type&gt;] value);
----

[.small]#xref:bsl/map-0af/insert-060.adoc[_» more&period;&period;&period;_]#

Insert the specified `value` into this map (in amortized constant time if the specified `hint` is a valid immediate successor to the key of `value`) if a key (the `first` element) equivalent to that of `value` does not already exist in this map&semi; otherwise, if a `value&lowbar;type` object whose key is equivalent to that of `value` already exists in this map, this method has no effect&period; Return an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this map whose key is equivalent to that of `value`&period; If `hint` is not a valid immediate successor to the key of `value`, this operation has `O&lsqb;log(N)&rsqb;` complexity, where `N` is the size of this map&period; This method requires that the (template parameter) types `KEY` and `VALUE` both be `copy&hyphen;insertable` into this map (see &lcub;Requirements on `KEY` and `VALUE`&rcub;)&period; The behavior is undefined unless `hint` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/map-0af/iterator.adoc[iterator]
xref:bsl/map-0af/insert-01.adoc[insert](
    xref:bsl/map-0af/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:bsl/map-0af/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:bsl/map-0af/insert-01.adoc[_» more&period;&period;&period;_]#

Insert into this map the value of each `value&lowbar;type` object in the range starting at the specified `first` iterator and ending immediately before the specified `last` iterator, if a key equivalent to that of the object is not already contained in this map&period; The (template parameter) type `INPUT&lowbar;ITERATOR` shall meet the requirements of an input iterator defined in the C&plus;&plus;11 standard &lsqb;input&period;iterators&rsqb;providing access to values of a type convertible to `value&lowbar;type`, and `value&lowbar;type` must be `emplace&hyphen;constructible` from `&ast;i` into this map, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;` (see &lcub;Requirements on `KEY` and `VALUE`&rcub;)&period; The behavior is undefined unless `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
void
xref:bsl/map-0af/insert-064.adoc[insert](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last);
----

[.small]#xref:bsl/map-0af/insert-064.adoc[_» more&period;&period;&period;_]#

Insert into this map a `value&lowbar;type` object created from the specified `value` (in amortized constant time if the specified `hint` is a valid immediate successor to the object created from `value`) if a key (the `first` element) equivalent to such an object does not already exist in this map&semi; otherwise, this method has no effect (other than possibly creating a temporary `value&lowbar;type` object)&period; Return an iterator referring to the (possibly newly inserted) `value&lowbar;type` object in this map whose key is equivalent to that of the object created from `value`&period; If `hint` is not a valid immediate successor to the object created from `value`, this operation has `O&lsqb;log(N)&rsqb;` complexity, where `N` is the size of this map&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;), and the `value&lowbar;type` be constructible from the (template parameter) `ALT&lowbar;VALUE&lowbar;TYPE`&period; The behavior is undefined unless `hint` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class ALT&lowbar;VALUE&lowbar;TYPE&gt;
xref:bsl/map-0af/iterator.adoc[iterator]
xref:bsl/map-0af/insert-0dd.adoc[insert](
    xref:bsl/map-0af/const_iterator.adoc[const&lowbar;iterator] hint,
    ALT&lowbar;VALUE&lowbar;TYPE&& value)
requires std&colon;&colon;is&lowbar;constructible&lt;value&lowbar;type,
                                             ALT&lowbar;VALUE&lowbar;TYPE&amp;&amp;&gt;&colon;&colon;value;
----

[.small]#xref:bsl/map-0af/insert-0dd.adoc[_» more&period;&period;&period;_]#


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