[#BloombergLP-bslstl-ForwardIterator]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::ForwardIterator
:relfileprefix: ../../
:mrdocs:

Given an `ITER&lowbar;IMP` type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a &quot;forward iterator&quot; in the C&plus;&plus; standard&period; If `T` is const&hyphen;qualified, then the resulting type is a const iterator&period; `T` shall not be a function, reference type or void&period; `ITER&lowbar;IMP` must provide public operations so that, for objects `i` and `j` of type `ITER&lowbar;IMP`, the following operations are supported&colon; &grave; ITER&lowbar;IMP i&semi; Default construction ITER&lowbar;IMP j(i)&semi; Copy construction i &equals; j Assignment &plus;&plus;i Increment to next element i &equals;&equals; j &sol;&sol; convertible to bool Equality comparison &ast;i &sol;&sol; reference convertible to T&amp; Element access (dereference) &grave;

== Synopsis

Declared in `&lt;bslstl&lowbar;forwarditerator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class T,
    class ITER&lowbar;IMP,
    class TAG&lowbar;TYPE = std::forward&lowbar;iterator&lowbar;tag&gt;
class ForwardIterator;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/ForwardIterator/difference_type.adoc[`difference&lowbar;type`] 
| Iterator difference type&period;
| xref:BloombergLP/bslstl/ForwardIterator/iterator_category.adoc[`iterator&lowbar;category`] 
| Standard forward iterator category tag&period;
| xref:BloombergLP/bslstl/ForwardIterator/pointer.adoc[`pointer`] 
| Pointer type for the iterator&apos;s value type&period;
| xref:BloombergLP/bslstl/ForwardIterator/reference.adoc[`reference`] 
| Reference type for the iterator&apos;s value type&period;
| xref:BloombergLP/bslstl/ForwardIterator/value_type.adoc[`value&lowbar;type`] 
| Value type for this iterator&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/ForwardIterator/2constructor-05.adoc[`ForwardIterator`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslstl/ForwardIterator/operator_assign.adoc[`operator&equals;`] 
| Copy the value of the specified `rhs` of another (compatible) `ForwardIterator` type, (e&period;g&period;, a mutable iterator of the same type) to this iterator&period; Return a reference to this modifiable object&period; Note that this method may be the copy&hyphen;assignment operator (inhibiting the implicit declaration of a copy&hyphen;assignment operator above), or may be an additional overload&period;
| xref:BloombergLP/bslstl/ForwardIterator/imp-0e.adoc[`imp`] 
| `imp` overloads
| xref:BloombergLP/bslstl/ForwardIterator/operator_star.adoc[`operator&ast;`] 
| Return a reference to the current, modifiable element&period; The behavior is undefined if this iterator has the past&hyphen;the&hyphen;end value for an iterator over the underlying sequence&period;
| xref:BloombergLP/bslstl/ForwardIterator/operator_inc.adoc[`operator&plus;&plus;`] 
| Increment to the next element&period; Return a reference to this modifiable iterator&period; The behavior is undefined if, on entry, this iterator has the past&hyphen;the&hyphen;end value for an iterator over the underlying sequence&period;
| xref:BloombergLP/bslstl/ForwardIterator/operator_ptr.adoc[`operator&hyphen;&gt;`] 
| Return a pointer to the current, modifiable element&period; The behavior is undefined if this iterator has the past&hyphen;the&hyphen;end value for an iterator over the underlying sequence&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/operator_not_eq-0bc.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` iterator does not have the same value as the specified `rhs` iterator, and `false` otherwise&period; Two iterators do not have the same value if (1) they do not refer to the same element and (2) both do not have the past&hyphen;the&hyphen;end iterator value for the underlying sequence&period; The behavior is undefined unless both iterators refer to the same underlying sequence&period;
| xref:BloombergLP/bslstl/operator_inc-008.adoc[`operator&plus;&plus;`]
| Increment the specified `iter` to the next element&period; Return the previous value of `iter`&period; The behavior is undefined if, on entry, `iter` has the past&hyphen;the&hyphen;end value for an iterator of the underlying sequence&period;
| xref:BloombergLP/bslstl/operator_eq-066.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` iterator has the same value as the specified `rhs` iterator, and `false` otherwise&period; Two iterators have the same value if they refer to the same element, or both have the past&hyphen;the&hyphen; end value for the underlying sequence&period; The behavior is undefined unless both iterators refer to the same underlying sequence&period;
|===

== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslstl/BidirectionalIterator.adoc[`BidirectionalIterator`] 
| Given an `ITER&lowbar;IMP` type that implements a minimal subset of an iterator interface, this template generates a complete iterator that meets all of the requirements of a &quot;bidirectional iterator&quot; in the C&plus;&plus; standard&period; If `T` is `const`&hyphen;qualified, then the resulting type is a constant iterator&period; `T` shall not be a function, reference type or void&period; `ITER&lowbar;IMP` must provide public operations so that, for objects `i` and `j` of type `ITER&lowbar;IMP`, the following operations are supported&colon; &grave; ITER&lowbar;IMP i&semi; default construction ITER&lowbar;IMP j(i)&semi; copy construction i &equals; j assignment &plus;&plus;i increment to next element &hyphen;&hyphen;i decrement to previous element i &equals;&equals; j &sol;&sol; convertible to bool equality comparison &ast;i &sol;&sol; reference convertible to T&amp; element access (dereference) &grave;
|===


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