BloombergLP::bslalg::DequePrimitives::erase

Erase a range of elements from a deque and close the gap.

Synopsis

Declared in <bslalg_dequeprimitives.h>

template<class ALLOCATOR>
static
DequePrimitives<VALUE_TYPE, BLOCK_LENGTH>::Iterator
erase(
    Iterator* toBegin,
    Iterator* toEnd,
    Iterator fromBegin,
    Iterator first,
    Iterator last,
    Iterator fromEnd,
    ALLOCATOR allocator);

Description

Call the destructor on each of the elements of a deque of parameterized VALUE_TYPE in the specified range [first .. last)]. Shift the elements to fill up the empty space after the erasure, using the smaller of the range defined by [fromBegin .. first)] and [last .. fromEnd)] after the erasure. Load in the specified toBegin and toEnd the new boundaries of the deque after erasure and return an iterator pointing to the element immediately following the removed elements. The behavior is undefined unless fromBegin <= first <= last <= fromEnd.

Return Value

iterator to the element immediately following the removed elements

Parameters

NameDescription
toBeginloads the new beginning iterator of the deque
toEndloads the new end iterator of the deque
fromBegincurrent beginning of the deque
firstbeginning of the range to erase
lastend of the range to erase (one past the last)
fromEndcurrent end of the deque
allocatorallocator used to destroy elements