
Vladimir Prus <ghost@cs.msu.su> writes:
And it seems to me, all single pass iterators have to store the value to allow for repeated operator*() calls.
Let's talk about concepts in the standard, i.e. input iterator. We invented single pass iterator; it can mean anything we say, and what we said doesn't imply that.
The only case when it's not needed is when iterator is a "view" of some other sequence (e.g. filter_iterator). But then iterator keeps a reference to that other sequence, and I don't see why copies of iterator can't retain the same value even if origial iterator is incremented.
It's not a question of whether they *can* but whether *they're required to*. AFAICT, they are not. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com