Insert the elements of values before position.
Synopsis
Declared in <bslstl_vector.h>
vector<VALUE_TYPE, ALLOCATOR>::iterator
insert(
const_iterator position,
std::initializer_list<VALUE_TYPE> values);
Description
Insert at the specified position in this vector each VALUE_TYPE object in the specified values initializer list, and 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, and move assignment operator of VALUE_TYPE), *this is unaffected. Throw std::length_error if `size() + values.size() > max_size()`. The behavior is undefined unless position is an iterator in the range [begin() .. end()] (both endpoints included). This method requires that the (template parameter) type VALUE_TYPE be copy‐insertable into this vector (see {Requirements on VALUE_TYPE}).
Return Value
iterator to the first inserted element, or position if empty
Parameters
Name |
Description |
position |
location before which elements are inserted |
values |
initializer list of values to insert |
Created with MrDocs