
11 Oct
2012
11 Oct
'12
1:19 p.m.
On Thu, Oct 11, 2012 at 1:44 PM, Oliver Kowalke <oliver.kowalke@gmx.de>wrote:
Also, the coroutine-fn is called immediately when the coroutine is called, and not deferred to the first operator() call.
I don't get it - when will be the body of coroutine-fn entered?
coro_t c( fn);//? or c(); //?
The first option.
what if the coroutine-fn expects some arguments?
coroutine< int( string) > c( fn); c( "abc");
auto fn(coroutine<string(int)> c) { assert(!c.has_data()); c(10); assert(c.has_data() && c.get() == "abc"); return c; } coroutine< int( string) > c( fn); assert(c.has_data() && c.get() == 10); c( "abc"); assert(c.terminated()); -- gpd