
11 Sep
2012
11 Sep
'12
7:14 a.m.
On Tuesday 11 September 2012 09:08:03 Oliver Kowalke wrote:
It is possible to implement it but I've concerns because the coroutine-fn has another signature/return type as the signature given to coroutine as template argument. It might confuse users.
typedef coroutine< int( int) > coro_t;
void fn( coro_t::self_t&, int) {...}
I don't follow the thread closely, but you could provide a placeholder type to indicate the self_t argument in the signature. Then typedef coroutine< int(self, int) > coro_t; or typedef coroutine< int(int, self) > coro_t; or typedef coroutine< int(int) > coro_t; are all possible and self-explaining.