[#bsl-vector-00d-insert-06bc] = xref:bsl.adoc[bsl]::xref:bsl/vector-00d.adoc[vector]::insert :relfileprefix: ../../ :mrdocs: Insert the range `[first, last)]` before `position`. == Synopsis Declared in `<bslstl_vector.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class INPUT_ITER> xref:bsl/vector-00d/iterator.adoc[iterator] insert( xref:bsl/vector-00d/const_iterator.adoc[const_iterator] position, INPUT_ITER first, INPUT_ITER last); ---- == Description Return an iterator referring to the first newly inserted element. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of `value_type`), `*this` is unaffected. Throw `std::length_error` if `size() + distance(first, last) > max_size()`. The (template parameter) type `INPUT_ITER` shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to `value_type`, and `value_type` must be `emplace‐constructible` from `*i` into this vector, where `i` is a dereferenceable iterator in the range `[first .. last)]` (see {Requirements on `VALUE_TYPE`}). The behavior is undefined unless `position` is an iterator in the range `[begin() .. end()]` (both endpoints included), and `first` and `last` refer to a range of valid values where `first` is at a position at or before `last`. NOTE: This function has been implemented inline due to an issue with the Sun compiler. == Return Value iterator to the first inserted element, or `position` if empty == Parameters [cols="1,4"] |=== | Name| Description | *position* | iterator before which to insert | *first* | start of the range to insert | *last* | end of the range to insert |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#