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

Insert `numElements` copies of `value` at `dstPosition`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/list-054/iterator.adoc[list&lt;VALUE, ALLOCATOR&gt;::iterator]
insert(
    xref:bsl/list-054/const_iterator.adoc[const&lowbar;iterator] dstPosition,
    xref:bsl/list-054/size_type.adoc[size&lowbar;type] numElements,
    xref:bsl/list-054/value_type.adoc[value&lowbar;type] const& value);
----

== Description

Return an iterator providing modifiable access to the first element in the newly inserted sequence of elements&period; This method requires that the (template parameter) `VALUE` be `copy&hyphen;insertable` into this list (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)&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
| *numElements*
| number of copies of `value` to insert
| *value*
| value copied into each inserted element
|===


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