bsl::list::erase

Remove the elements in the half-open range [dstBegin .. dstEnd)].

Synopsis

Declared in <bslstl_list.h>

list<VALUE, ALLOCATOR>::iterator
erase(
    const_iterator dstBegin,
    const_iterator dstEnd);

Description

Return a non-const iterator equivalent to dstEnd. The behavior is undefined unless dstBegin is an iterator in the range [begin() .. end()] and dstEnd is an iterator in the range [dstBegin .. end()] (both endpoints included). Note that dstBegin may be equal to dstEnd, in which case the list is not modified.

Return Value

iterator to the element following the last erased element

Parameters

NameDescription
dstBeginiterator to the first element to remove
dstEnditerator past the last element to remove