Boost logo

Boost :

From: Neal D. Becker (ndbecker2_at_[hidden])
Date: 2004-05-13 13:02:09

David Abrahams wrote:

> "Neal D. Becker" <ndbecker2_at_[hidden]> writes:
>> I wonder if there is a more elegant approach?
> Yeah: cache a value in the iterator with boost::optional<value_type>.
> Put a new value in the cache when the iterator is incremented.

Good suggestion! I'll post the modified code if anyone is interested.

Actually, though, I was wondering if anyone had a more elegant approach in a
more general sense, to the problem of transforming some kind of source into
a sequence. Possibly "range" could be useful, but I don't know.

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