BloombergLP::bdlcc::Deque::tryPopFront

Remove up to maxNumItems from the front into buffer.

Synopsis

Declared in <bdlcc_deque.h>

void
tryPopFront(
    size_type maxNumItems,
    std::vector<TYPE>* buffer);

Description

Remove up to the specified maxNumItems from the front of this container into the specified buffer. The removed items are appended to buffer as if by repeated application of buffer->push_back(popFront()) while the container is not empty and maxNumItems have not yet been removed. Note that *buffer is not cleared -- the popped items are appended after any pre-existing contents.

Parameters

NameDescription
maxNumItemsmaximum number of items to remove
buffervector that receives the removed items