Boost logo

Boost Users :

Subject: Re: [Boost-users] [Review.Coroutine] Coroutine review comments
From: Nat Linden (nat_at_[hidden])
Date: 2012-09-17 11:35:29


[This is no longer a review comment, simply a follow-up to discussion
arising from review comments.]

On Mon, Sep 10, 2012 at 5:11 PM, Nat Linden <nat_at_[hidden]> wrote:

> Examples I would like to see include:
>
> - using a recursive generator to emit iterators over a tree structure
> (possibly wrapped in a Boost iterator facade)

It occurred to me that one could write a generic generator_iterator
adapter (somewhat analogous to transform_iterator). This adapter could
accept an arbitrary generator, mapping the generator API into the
iterator API. Following convention, a default-constructed iterator
would represent the end of the sequence.

I'd really like for that adapter to be included as part of the
Boost.Coroutine library. I'd like to be able to write a
generator-function, wrap it in a generator object and wrap that in the
adapter to get a forward iterator over the results from that
generator-function.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net