| 1 |
#ifndef INCLUDED_START_ |
| 2 |
#define INCLUDED_START_ |
| 3 |
|
| 4 |
#include "../../promisebase/promisebase.h" |
| 5 |
|
| 6 |
// no operator co_await, separate Awaiter |
| 7 |
|
| 8 |
//start |
| 9 |
class Start |
| 10 |
{ |
| 11 |
struct State: public PromiseBase<Start, State> |
| 12 |
{}; |
| 13 |
|
| 14 |
std::coroutine_handle<State> d_handle; |
| 15 |
|
| 16 |
public: |
| 17 |
using promise_type = State; |
| 18 |
using Handle = std::coroutine_handle<State>; |
| 19 |
|
| 20 |
explicit Start(Handle handle); |
| 21 |
~Start(); |
| 22 |
|
| 23 |
Handle handle() const; |
| 24 |
void go(); |
| 25 |
}; |
| 26 |
|
| 27 |
inline Start::Handle Start::handle() const |
| 28 |
{ |
| 29 |
return d_handle; |
| 30 |
} |
| 31 |
|
| 32 |
extern Start g_start; |
| 33 |
|
| 34 |
#endif |