Observation 1: A C++ output iterator requires that &r == &++r
, while an input iterator does not mention this requirement. See [C++11: 24.2.{3,4}]
Observation 2: Forward, bidirectional, and random-access iterators satisfy the input iterator requirements [24.2.{5,6,7}:1], but not necessarily the output iterator requirements unless they are mutable [24.2.1:4].
Observation 3: Bidirectional iterators add a prefix decrement operation, with the requirement &r == &--r
[24.2.6].
So, is it true that a constant bidirectional iterator must satisfy &r == &--r
but not necessarily &r == &++r
, while a mutable bidirectional iterator must satisfy both?
Can you address how this requirement might influence an implementation?
MvG, below, asks the question I really meant:
- When does it make sense for a constant Forward iterator to not satisfy
&r == &++r
?