class
<iterator>
std::forward_iterator_tagstruct forward_iterator_tag {};
Forward iterator category
Empty class to identify the category of an iterator as a forward iterator: Forward iteratorsPerforming operations on a forward iterator that is dereferenceable never makes its iterator value non-dereferenceable. This enables algorithms that use this category of iterators to use multiple copies of an iterator to pass more than once by the same iterator values.
All bidirectional and random-access iterators are also valid forward iterators.
There is not a single type of forward iterator: Each container may define its own specific iterator type able to iterate through it and access its elements. But all forward iterators support -at least- the following operations:
property valid expressions Is default-constructible, copy-constructible, copy-assignable and destructibleX a;
X b(a);
b = a;
Can be compared for equivalence using the equality/inequality operators
a == b
a != b
Can be dereferenced as an rvalue (if in a dereferenceable state). *a
a->m
For mutable iterators (non-constant iterators):
*a = t
Can be incremented (if in a dereferenceable state).
++a
a++
*a++
property valid expressions Is default-constructible, copy-constructible, copy-assignable and destructible X a;
X b(a);
b = a;
Can be compared for equivalence using the equality/inequality operators
a == b
a != b
Can be dereferenced as an rvalue (if in a dereferenceable state). *a
a->m
For mutable iterators (non-constant iterators):
*a = t
Can be incremented (if in a dereferenceable state).
++a
a++
*a++
Lvalues are swappable. swap(a,b)
Constant iterators are iterators that do not fulfill the requirements of an output iterator; Dereferencing them yields a reference to a constant element (such as const T&
).
These properties are the same as those of bidirectional iterators, except that forward iterators only support being incremented (but not decreased).
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4