Primitive random‐access iterator over a block‐based deque.

Synopsis

Declared in <bslalg_dequeiterator.h>

template<
    class VALUE_TYPE,
    int BLOCK_LENGTH>
class DequeIterator;

Description

Implementation of a deque iterator, parameterized by the VALUE_TYPE, for a deque with the parameterized BLOCK_LENGTH, and suitable for use by the bslstl::RandomAccessIterator adapter. Note that BLOCK_LENGTH is the number of items of VALUE_TYPE within a block, not the size of a block in bytes.

Member Functions

Name

Description

DequeIterator [constructor]

Constructors

blockBegin

Return the address of the first element in the block pointed to by this iterator.

blockEnd

Return the address of (one‐past) the last element in the block pointed to by this iterator.

blockPtr

Return the address of the block pointer for this iterator.

nextBlock

Set this iterator to point to the first element of the next block.

offsetInBlock

Return the offset of the element pointed to by this iterator, from the beginning of the block containing it.

operator*

Return a reference to the element pointed to by this iterator.

operator+

Return an iterator pointing the element at the specified offset after this iterator.

operator++

Increment this iterator to the next element in the deque.

operator+=

Advance this iterator by the specified offset.

operator‐

Subtraction operators

operator‐‐

Decrement this iterator to the previous element in the deque.

operator‐=

Move this iterator backward by the specified offset.

previousBlock

Set this iterator to point to the first (not the last) element of the previous block.

remainingInBlock

Return how many elements remain in this block from the current position.

setBlock

Set this iterator to point to the first element of the block pointed to by the specified blockPtrPtr.

valuePtr

Return the address of the parameterized VALUE_TYPE object pointed to by this iterator.

valuePtrDecrement

Decrement the value pointer within the current block.

valuePtrIncrement

Increment the value pointer within the current block.

Specializations

Name

Description

DequeIterator<VALUE_TYPE, 1>

DequeIterator specialization for a single element per block.

Friends

Name

Description

BloombergLP::bslalg::operator<=>

Perform a three‐way comparison between the specified lhs and rhs iterators. The behavior is undefined unless lhs and rhs are iterators over the same deque.

BloombergLP::bslalg::operator==

Return true if lhs and rhs point to the same element.

Created with MrDocs