| 1 | #include <coroutine> |
| 2 | |
| 3 | struct promise; |
| 4 | |
| 5 | struct coroutine : std::coroutine_handle<promise> |
| 6 | { |
| 7 | using promise_type = ::promise; |
| 8 | }; |
| 9 | |
| 10 | struct promise |
| 11 | { |
| 12 | coroutine get_return_object() { return {coroutine::from_promise(*this)}; } |
| 13 | std::suspend_always initial_suspend() noexcept { return {}; } |
| 14 | std::suspend_always final_suspend() noexcept { return {}; } |
| 15 | void return_void() {} |
| 16 | void unhandled_exception() {} |
| 17 | }; |
| 18 | |
| 19 | static coroutine |
| 20 | f() |
| 21 | { |
| 22 | co_return; |
| 23 | } |
| 24 | |
| 25 | int |
| 26 | main(int argc, char **argv) |
| 27 | { |
| 28 | return 0; |
| 29 | } |