|
template<typename THUNK > |
| coroutine (THUNK &&th) |
| construct a coroutine from a thunk
|
|
template<typename StackAllocator , typename THUNK > |
| coroutine (StackAllocator &&sa, THUNK &&th) |
| construct a coroutine from a stack allocator and thunk
|
|
| coroutine (const coroutine &source)=delete |
|
| coroutine (coroutine &&rhs) noexcept |
| Move Constructor.
|
|
coroutine & | operator= (const coroutine &rhs)=delete |
|
coroutine & | operator= (coroutine &&rhs) noexcept |
| Move Assignment.
|
|
virtual void | run () |
| Execute until thunk completes or yield() is called. More...
|
|
void | yield () |
| Pause execution and return to run() caller. More...
|
|
bool | complete () |
| Returns true if thunk is complete, else false since the coroutine yielded early.
|
|
A coroutine object. Argument thunk can yield execution at any point using mce::yield(). make_thunk() from the thunk.hpp is helpful for making executable functions to pass to coroutine constructor.