The proposed boost::coroutine library provides stackful coroutines (vs the stackless ones I showed).
The advantage of having a stack is that you can yield from a nested function, which means you can layer non-async-aware APIs (e.g. a boost.spirit parser) over the top of async calls.
However, one of the disadvantages is that you have a stack :)
You can't transparently implement composed operations using stackful coroutines because you have to pass the coroutine's "self" reference to the function. (Well actually you could do it by creating a new coroutine stack for each composed operation,…