Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-09-09 06:58:51


From: "Anthony Williams" <anthwil_at_[hidden]>

> Is it possible to use boost iterator adaptors to generate a bounded
sequence?

Yes.

> As an example, I will use a modified version of the
boost::generator_iterator
> example, which writes the numbers 1 to 10:
>

<snip code>

> In my actual usage, the generator does more than increase a state; the
point
> is I want to stop when I reach a defined condition (which can be encoded
as
> another instance of the generator if required)

Do you have another question about this?
Did you read the docs for iterator_adaptor?
It's actually pretty easy to use...

-----------------------------------------------------------
           David Abrahams * Boost Consulting
dave_at_[hidden] * http://www.boost-consulting.com


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