insert overloads

Synopses

Declared in <bslstl_deque.h>

Insert at the specified position in this deque the specified move‐insertable value, and return an iterator providing modifiable access to the newly inserted element. value is left in a valid but unspecified state. If an exception is thrown (other than by the copy constructor, move constructor, assignment operator, or move assignment operator of value_type), this method has no effect. This method requires that the (template parameter) VALUE_TYPE be move‐insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

Insert at the specified position in this deque the value of each value_type object in the specified values initializer list, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

deque<VALUE_TYPE, ALLOCATOR>::iterator
insert(
    const_iterator position,
    std::initializer_list<value_type> values);

Insert at the specified position in this deque a copy of the specified value, and return an iterator providing modifiable access to the newly inserted element. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

deque<VALUE_TYPE, ALLOCATOR>::iterator
insert(
    const_iterator position,
    VALUE_TYPE const& value);

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. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. This method requires that the (template parameter) VALUE_TYPE be copy‐insertable into this deque (see {Requirements on VALUE_TYPE}). The behavior is undefined unless position is an iterator in the range [cbegin() .. cend()] (both endpoints included).

deque<VALUE_TYPE, ALLOCATOR>::iterator
insert(
    const_iterator position,
    size_type numElements,
    VALUE_TYPE const& value);

Insert at the specified position in this deque the values in the range starting at the specified first and ending immediately before the specified last iterators of the (template parameter) type INPUT_ITERATOR, and return an iterator providing modifiable access to the first element in the newly inserted sequence of elements. This method offers full guarantee of rollback in case an exception is thrown other than by the VALUE_TYPE copy constructor or assignment operator. The (template parameter) type INPUT_ITERATOR shall meet the requirements of an input iterator defined in the C++11 standard [input.iterators]providing access to values of a type convertible to value_type, and value_type must be emplace‐constructible from *i into this deque, 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 [cbegin() .. cend()] (both endpoints included), and first and last refer to a sequence of valid values where first is at a position at or before last.

template<class INPUT_ITERATOR>
deque<VALUE_TYPE, ALLOCATOR>::iterator
insert(
    const_iterator position,
    INPUT_ITERATOR first,
    INPUT_ITERATOR last);

Created with MrDocs