bsl::list::insert

insert overloads

Synopses

Declared in <bslstl_list.h>

Insert the move-insertable value at dstPosition.

list<VALUE, ALLOCATOR>::iterator
insert(
    const_iterator dstPosition,
    BloombergLP::bslmf::MovableRef<value_type> value);
» more...

Insert the values from values at the specified dstPosition.

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

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

list<VALUE, ALLOCATOR>::iterator
insert(
    const_iterator dstPosition,
    value_type const& value);
» more...

Insert numElements copies of value at dstPosition.

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

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;
» more...

Return Value

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

Parameters

NameDescription
dstPositionlocation before which the element is inserted
valueelement to move-insert
valuesinitializer list of values to insert
numElementsnumber of copies of value to insert
firststart of the iterator range
lastone past the end of the iterator range