Boost logo

Boost :

Subject: Re: [boost] Lazy Spirit Generators?
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2017-02-14 02:35:45


> In a hobby project, I am using Spirit Karma generators. As far as I have
> understood Spirit Karma, it is not designed to work lazily in the
> iterator based interface. It takes an output iterator and writes to it
> until it has finished.
>
> What I am thinking of is a kind of generating range. E.g.:
>
> for(auto& char:
> generator_range(double_ << " + " << double_ << "i",
> context, c.real(), c.imag())) {
> // do whatever with the single characters returned by the generator
> }
>
> Is there something like that, which I simply have not found?

The short answer is 'no'. Once we have co_await/co_yield and coroutines
support in the language it could be easily built, though.

Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu


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