[#bsl-multiset-03-insert-07]
= xref:bsl.adoc[bsl]::xref:bsl/multiset-03.adoc[multiset]::insert
:relfileprefix: ../../
:mrdocs:

`insert` overloads

== Synopses

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

Insert the specified `value` into this multiset&period; If a range containing elements equivalent to `value` already exists in this multiset, insert `value` at the end of that range&period; `value` is left in a valid but unspecified state&period; Return an iterator referring to the newly inserted `value&lowbar;type` object in this multiset that is equivalent to `value`&period; This method requires that the (template parameter) type `KEY` be `move&hyphen;insertable` into this multiset (see &lcub;Requirements on `KEY`&rcub;)&period;


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

[.small]#xref:bsl/multiset-03/insert-084.adoc[_» more&period;&period;&period;_]#

Insert into this multiset the value of each `value&lowbar;type` object in the specified `values` initializer list&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this multiset (see &lcub;Requirements on `KEY`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:bsl/multiset-03/insert-049.adoc[insert](std::initializer&lowbar;list&lt;KEY&gt; values);
----

[.small]#xref:bsl/multiset-03/insert-049.adoc[_» more&period;&period;&period;_]#

Insert the specified `value` into this multiset&period; If a range containing elements equivalent to `value` already exists, insert the `value` at the end of that range&period; Return an iterator referring to the newly inserted `value&lowbar;type` object&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this multiset (see &lcub;Requirements on `KEY`&rcub;)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/multiset-03/iterator.adoc[multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator]
xref:bsl/multiset-03/insert-081.adoc[insert](xref:bsl/multiset-03/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:bsl/multiset-03/insert-081.adoc[_» more&period;&period;&period;_]#

Insert the specified `value` into this multiset (in amortized constant time if the specified `hint` is a valid immediate successor to `value`)&period; `value` is left in a valid but unspecified state&period; Return an iterator referring to the newly inserted `value&lowbar;type` object in this multiset that is equivalent to `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 multiset&period; This method requires that the (template parameter) type `KEY` be `move&hyphen;insertable` into this multiset (see &lcub;Requirements on `KEY`&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/multiset-03/iterator.adoc[multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator]
xref:bsl/multiset-03/insert-0a.adoc[insert](
    xref:bsl/multiset-03/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;value&lowbar;type&gt;] value);
----

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

Insert the specified `value` into this multiset (in amortized constant time if the specified `hint` is a valid immediate successor to `value`)&period; Return an iterator referring to the newly inserted `value&lowbar;type` object in this multiset that is equivalent to `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 multiset&period; This method requires that the (template parameter) type `KEY` be `copy&hyphen;insertable` into this multiset (see &lcub;Requirements on `KEY`&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/multiset-03/iterator.adoc[multiset&lt;KEY, COMPARATOR, ALLOCATOR&gt;::iterator]
xref:bsl/multiset-03/insert-040.adoc[insert](
    xref:bsl/multiset-03/const_iterator.adoc[const&lowbar;iterator] hint,
    xref:bsl/multiset-03/value_type.adoc[value&lowbar;type] const& value);
----

[.small]#xref:bsl/multiset-03/insert-040.adoc[_» more&period;&period;&period;_]#

Insert into this multiset 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&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;24&period;2&period;3&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 multiset, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;` (see &lcub;Requirements on `KEY`&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/multiset-03/insert-0e.adoc[insert](
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last);
----

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


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