Boost logo

Boost :

From: Daryle Walker (dwalker07_at_[hidden])
Date: 2002-11-01 01:11:30


Right now, a generator is an object that returns a value from a
zero-operand operator(). I wonder if we can make a similar concept
that adds a Boolean conversion to a generator object. The conversion
yields TRUE if the object can still return valid items, FALSE
otherwise. This is for generators that have a limited usefulness that
can't be determined in advance. The standard could have had these kind
of generators for reading from input streams instead of having a clunky
iterator adaptor with strange end-iterator properties. (You can still
have clunky iterator adaptors, they would define a default-constructed
iterator with an internal generator that is invalid.)

I'm posting this here because I'm thinking of generator ideas (like
I/O) that should have this validity check.

Daryle


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk