On Fri, Oct 5, 2012 at 2:32 PM, Oliver Kowalke
Am 05.10.2012 20:10, schrieb Nat Linden:
On Fri, Oct 5, 2012 at 11:22 AM, Oliver Kowalke
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.