For input iterators, why a == b does not imply ++a == ++b?

§24.1.1/3 from C++03 Standard reads,

For input iterators, a == b does not imply ++a == ++b. (Equality does not guarantee the substitution property or referential transparency.) Algorithms on input iterators should never attempt to pass through the same iterator twice. They should be single pass algorithms. Value type T is not required to be an Assignable type (23.1). These algorithms can be used with istreams as the source of the input data through the istream_iterator class.

I couldn't understand the bold text in the above quotation. Can anyone help me understanding this?

Also, what does the following statement (italicized text in the above quotation) mean? How is it related to a==b and ++a==++b expressions?

Equality does not guarantee the substitution property or referential transparency.

14
задан Nawaz 13 May 2011 в 04:48
поделиться