Forward iterator category
Forward iterators are iterators especially designed for sequential access, where the algorithm passes through all the elements in the range from the beginning to the end.
They have the following characteristics:
characteristic | valid expressions |
Can be default-constructed | X a;
X() |
Can be copied and copy-constructed | X b(a);
b = a; |
Accepts equality/inequality comparisons.
Equal iterators imply the same element is pointed | a == b
a != b |
Can be dereferenced (when not null) | *a
a->m |
Can be incremented (when not null) | ++a
a++
*a++ |
Where X is an iterator type, and a and b are objects of this iterator type.
These characteristics are the same of bidirectional iterators, except that forward iterators only support increment and not decrement.
See also
|