
13 May
2004
13 May
'04
6:02 p.m.
David Abrahams wrote:
"Neal D. Becker" <ndbecker2@verizon.net> 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.