insert overloads

Synopses

Declared in <bslstl_list.h>

Insert the move‐insertable value at dstPosition.

Insert the values from values at the specified dstPosition.

list<VALUE, ALLOCATOR>::iterator
insert(
    const_iterator dstPosition,
    std::initializer_list<value_type> values);

Insert a copy of value at dstPosition and return an iterator to it.

Insert numElements copies of value at dstPosition.

list<VALUE, ALLOCATOR>::iterator
insert(
    const_iterator dstPosition,
    size_type numElements,
    value_type const& value);

Insert the values in [first .. last)] at the specified dstPosition.

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;

Return Value

  • iterator to the newly inserted element

  • iterator to the first inserted element, or dstPosition if empty

Parameters

Name

Description

dstPosition

location before which the element is inserted

value

element to move‐insert

values

initializer list of values to insert

numElements

number of copies of value to insert

first

start of the iterator range

last

one past the end of the iterator range

Created with MrDocs