insert overloads
Declared in <bslstl_list.h>
Insert at the specified dstPosition in this list 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 be move-insertable into this list (see {Requirements on VALUE}). The behavior is undefined unless dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included).
list<VALUE, ALLOCATOR>::iterator
insert(
const_iterator dstPosition,
BloombergLP::bslmf::MovableRef<value_type> value);
» more...
Insert at the specified dstPosition in this list 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 requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}). The behavior is undefined unless dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included).
list<VALUE, ALLOCATOR>::iterator
insert(
const_iterator dstPosition,
std::initializer_list<value_type> values);
» more...
Insert at the specified dstPosition in this list 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 copy constructor or assignment operator. This method requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}). The behavior is undefined unless dstPosition is an iterator in the range [cbegin() .. cend()]endpoints included).
list<VALUE, ALLOCATOR>::iterator
insert(
const_iterator dstPosition,
value_type const& value);
» more...
Insert at the specified dstPosition in this list 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 requires that the (template parameter) VALUE be copy-insertable into this list (see {Requirements on VALUE}). The behavior is undefined unless dstPosition is an iterator in the range [cbegin() .. cend()] (both endpoints included).
list<VALUE, ALLOCATOR>::iterator
insert(
const_iterator dstPosition,
size_type numElements,
value_type const& value);
» more...
Insert at the specified dstPosition in this list 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. 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 list, where i is a dereferenceable iterator in the range [first .. last)] (see {Requirements on VALUE}). The behavior is undefined unless dstPosition 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>
iterator
insert(
const_iterator dstPosition,
INPUT_ITERATOR first,
INPUT_ITERATOR last)
requires !is_arithmetic<INPUT_ITERATOR>::value &&
!is_enum<INPUT_ITERATOR>::value;
» more...