Boost logo

Boost Users :

Subject: Re: [Boost-users] [coroutine] new versions
From: Nat Linden (nat_at_[hidden])
Date: 2012-10-05 15:08:10


On Fri, Oct 5, 2012 at 2:32 PM, Oliver Kowalke <oliver.kowalke_at_[hidden]> wrote:

> Am 05.10.2012 20:10, schrieb Nat Linden:

>> On Fri, Oct 5, 2012 at 11:22 AM, Oliver Kowalke <oliver.kowalke_at_[hidden]>
>> wrote:
>>
>>> Version 1) requires that coroutine-fn has only one argument ==
>>> coroutine<>::self_t. Other arguments are accessed via
>>> coroutine<>::self_t::get< int >() and results via coroutine<>::get().
>>> interface provides input/output iterators.

>> I'm not sure this is an improvement over having yield() return a
>> tuple.

> I decided to remove the parameters from the coroutine-fn signature and
> let the user access them via self_t::get< N >(). Then it should be clearer
> when and where the values are updated/available after a yield/resume
> cycle.

I can see that that eliminates the need for the coroutine-fn code to
know whether it's accessing the parameters for the first time (obtain
from formal function parameters) or a subsequent time (returned from
yield()). Okay.


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