[#bsl-deque-0c-insert-02]
= xref:bsl.adoc[bsl]::xref:bsl/deque-0c.adoc[deque]::insert
:relfileprefix: ../../
:mrdocs:

Insert `numElements` copies of `value` before `position`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/deque-0c/iterator-02.adoc[deque&lt;VALUE&lowbar;TYPE, ALLOCATOR&gt;::iterator]
insert(
    xref:bsl/deque-0c/const_iterator.adoc[const&lowbar;iterator] position,
    xref:bsl/deque-0c/size_type.adoc[size&lowbar;type] numElements,
    VALUE&lowbar;TYPE const& value);
----

== Description

Insert at the specified `position` in this deque the specified `numElements` copies of the specified `value`, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements&period; This method offers full guarantee of rollback in case an exception is thrown other than by the `VALUE&lowbar;TYPE` copy constructor or assignment operator&period; This method requires that the (template parameter) `VALUE&lowbar;TYPE` be `copy&hyphen;insertable` into this deque (see &lcub;Requirements on `VALUE&lowbar;TYPE`&rcub;)&period; The behavior is undefined unless `position` is an iterator in the range `&lsqb;cbegin() &period;&period; cend()&rsqb;` (both endpoints included)&period;

== Return Value

iterator to the first inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| iterator before which to insert
| *numElements*
| number of copies to insert
| *value*
| value to copy&hyphen;insert
|===


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