[#bsl-vector-03-insert-040]
= xref:bsl.adoc[bsl]::xref:bsl/vector-03.adoc[vector&lt;bool&gt;]::insert
:relfileprefix: ../../
:mrdocs:

Insert at the specified `position` in this vector the values in the range starting at the specified `first` element, and ending immediately before the specified `last` element&period; Return an iterator referring to the first newly inserted element&period; If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of `value&lowbar;type`), `&ast;this` is unaffected&period; Throw `std&colon;&colon;length&lowbar;error` if `size() &plus; distance(first, last) &gt; max&lowbar;size()`&period; The (template parameter) type `INPUT&lowbar;ITER` 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 vector, where `i` is a dereferenceable iterator in the range `&lsqb;first &period;&period; last)&rsqb;` (see &lcub;Requirements on `VALUE&lowbar;TYPE`&rcub;)&period; The behavior is undefined unless `position` is an iterator in the range `&lsqb;begin() &period;&period; end()&rsqb;` (both endpoints included), and `first` and `last` refer to a range of valid values where `first` is at a position at or before `last`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class INPUT&lowbar;ITER&gt;
xref:bsl/vector-03/iterator.adoc[iterator]
insert(
    xref:bsl/vector-03/const_iterator.adoc[const&lowbar;iterator] position,
    INPUT&lowbar;ITER first,
    INPUT&lowbar;ITER last);
----

== Description

NOTE&colon; This function has been implemented inline due to an issue with the Sun compiler&period;


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