| 1 |
#ifndef INCLUDED_DONE_ |
| 2 |
#define INCLUDED_DONE_ |
| 3 |
|
| 4 |
#include "../../promisebase/promisebase.h" |
| 5 |
|
| 6 |
class Done |
| 7 |
{ |
| 8 |
struct State: public PromiseBase<Done, State> |
| 9 |
{}; |
| 10 |
|
| 11 |
std::coroutine_handle<State> d_handle; |
| 12 |
static size_t s_count; |
| 13 |
|
| 14 |
public: |
| 15 |
using promise_type = State; |
| 16 |
using Handle = std::coroutine_handle<State>; |
| 17 |
|
| 18 |
explicit Done(Handle handle); |
| 19 |
~Done(); |
| 20 |
|
| 21 |
Handle handle() const; |
| 22 |
}; |
| 23 |
|
| 24 |
inline Done::Handle Done::handle() const |
| 25 |
{ |
| 26 |
return d_handle; |
| 27 |
} |
| 28 |
|
| 29 |
extern Done g_done; |
| 30 |
|
| 31 |
#endif |