[#bsl-list-054-insert-0e]
= xref:bsl.adoc[bsl]::xref:bsl/list-054.adoc[list]::insert
:relfileprefix: ../../
:mrdocs:

Insert the values in `&lsqb;first &period;&period; last)&rsqb;` at the specified `dstPosition`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITERATOR&gt;
xref:bsl/list-054/iterator.adoc[iterator]
insert(
    xref:bsl/list-054/const_iterator.adoc[const&lowbar;iterator] dstPosition,
    INPUT&lowbar;ITERATOR first,
    INPUT&lowbar;ITERATOR last)
requires !is&lowbar;arithmetic&lt;INPUT&lowbar;ITERATOR&gt;&colon;&colon;value &amp;&amp;
                        !is&lowbar;enum&lt;INPUT&lowbar;ITERATOR&gt;&colon;&colon;value;
----

== Description

Return an iterator providing modifiable access to the first element in the newly inserted sequence of elements&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 list, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;` (see &lcub;Requirements on `VALUE`&rcub;)&period; The behavior is undefined unless `dstPosition` is an iterator in the range `&lsqb;cbegin() &period;&period; cend()&rsqb;` (both endpoints included), and `first` and `last` refer to a sequence of valid values where `first` is at a position at or before `last`&period;

== Return Value

iterator to the first inserted element, or `dstPosition` if empty

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstPosition*
| location before which elements are inserted
| *first*
| start of the iterator range
| *last*
| one past the end of the iterator range
|===


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