Boost logo

Boost :

Subject: Re: [boost] [Review.Coroutine] More comments, questions and suggestions
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-09-11 03:14:03

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;


typedef coroutine< int(int, self) > coro_t;


typedef coroutine< int(int) > coro_t;

are all possible and self-explaining.

Boost list run by bdawes at, gregod at, cpdaniel at, john at