[#BloombergLP-bslalg-DequeIterator-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::DequeIterator
:relfileprefix: ../../
:mrdocs:

Implementation of a deque iterator, parameterized by the `VALUE&lowbar;TYPE`, for a deque with the parameterized `BLOCK&lowbar;LENGTH`, and suitable for use by the `bslstl&colon;&colon;RandomAccessIterator` adapter&period; Note that `BLOCK&lowbar;LENGTH` is the number of items of `VALUE&lowbar;TYPE` within a block, not the size of a block in bytes&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;dequeiterator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE&lowbar;TYPE,
    int BLOCK&lowbar;LENGTH&gt;
class DequeIterator;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/DequeIterator-0d/2constructor-04.adoc[`DequeIterator`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslalg/DequeIterator-0d/blockBegin.adoc[`blockBegin`] 
| Return the address of the first element in the block pointed to by this iterator&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/blockEnd.adoc[`blockEnd`] 
| Return the address of (one&hyphen;past) the last element in the block pointed to by this iterator&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/blockPtr-02.adoc[`blockPtr`] 
| Return the address of the block pointer pointed to by this iterator&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/nextBlock.adoc[`nextBlock`] 
| Set this iterator to point to the first element of the next block&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/offsetInBlock.adoc[`offsetInBlock`] 
| Return the offset of the element pointed to by this iterator, from the beginning of the block containing it&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_star.adoc[`operator&ast;`] 
| Return a reference to the parameterized `VALUE&lowbar;TYPE` object pointed to by this iterator&period; Note that this value is modifiable if `VALUE&lowbar;TYPE` is modifiable, and non&hyphen;modifiable if it is not&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_plus.adoc[`operator&plus;`] 
| Return an iterator pointing the element at the specified `offset` after this iterator&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_inc.adoc[`operator&plus;&plus;`] 
| Increment this iterator to point to the next element in the corresponding deque (i&period;e&period;, the element following the current one in the same block or, if the current element is the last one in the block, the first element in the next block)&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Advance this iterator by the specified `offset`&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_minus-06.adoc[`operator&hyphen;`] 
| Subtraction operators
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Decrement this iterator to point to the previous element in the corresponding deque (i&period;e&period;, the element preceding the current one in the same block or, if the current element is the first one in the block, the last element in the previous block)&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/operator_minus_eq.adoc[`operator&hyphen;&equals;`] 
| Move this iterator backward by the specified `offset`&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/previousBlock.adoc[`previousBlock`] 
| Set this iterator to point to the first (not the last) element of the previous block&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/remainingInBlock.adoc[`remainingInBlock`] 
| Return the number of elements in the block pointed to by this iterator, until the end of this block, starting at (and including) the element pointed to by this iterator&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/setBlock.adoc[`setBlock`] 
| Set this iterator to point to the first element of the block pointed to by the specified `blockPtrPtr`&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/valuePtr.adoc[`valuePtr`] 
| Return the address of the parameterized `VALUE&lowbar;TYPE` object pointed to by this iterator&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/valuePtrDecrement.adoc[`valuePtrDecrement`] 
| Decrement this iterator to point to the next element in the block of the corresponding deque&period; The behavior is undefined unless this iterator is pointed to a valid position of the deque&period; Note that this method is used only for optimization purposes in `bslstl&lowbar;Deque`, and clients of this package should not use this directly&period;
| xref:BloombergLP/bslalg/DequeIterator-0d/valuePtrIncrement.adoc[`valuePtrIncrement`] 
| Increment this iterator to point to the next element in the block of the corresponding deque&period; The behavior is undefined unless this iterator is pointed to a valid position of the deque&period; Note that this method is used only for optimization purposes in `bslstl&lowbar;Deque`, and clients of this package should not use this directly&period;
|===


== Specializations

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/DequeIterator-01.adoc[`DequeIterator&lt;VALUE&lowbar;TYPE, 1&gt;`] 
| This partial specialization of `DequeIterator` for the case when there is a single element per block uses simpler storage and a simpler implementation&period; The contract for all functions is the same, and so not repeated&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bslalg/operator_3way-0aa.adoc[BloombergLP::bslalg::operator&lt;&equals;&gt;]`
| Perform a three&hyphen;way comparison between the specified `lhs` and `rhs` iterators&period; The behavior is undefined unless `lhs` and `rhs` are iterators over the same deque&period;
| `xref:BloombergLP/bslalg/operator_eq-02.adoc[BloombergLP::bslalg::operator&equals;&equals;]`
| Return `true` if the specified `lhs` iterator points to the same element in the same block as the specified `rhs` iterator, and `false` otherwise&period; The behavior is undefined unless `lhs` and `rhs` are iterators over the same deque&period; Note that this friend is a regular functon, not a function template, so there is no way to declare it outside the class in order to provide the definition&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
