Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-04-22 06:07:49

Vladimir Prus <ghost_at_[hidden]> 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

Boost list run by bdawes at, gregod at, cpdaniel at, john at