| 30 | |
| 31 | template<class Rep, class Period> |
| 32 | auto operator co_await(std::chrono::duration<Rep, Period> d) |
| 33 | { |
| 34 | struct awaiter |
| 35 | { |
| 36 | std::chrono::system_clock::duration duration; |
| 37 | awaiter(std::chrono::system_clock::duration d) |
| 38 | : duration(d) |
| 39 | {} |
| 40 | |
| 41 | bool await_ready() const { return duration.count() <= 0; } |
| 42 | void await_resume() {} |
| 43 | void await_suspend(std::coroutine_handle<> h) { } |
| 44 | }; |
| 45 | |
| 46 | return awaiter{d}; |
| 47 | } |
| 48 | using namespace std::chrono; |
| 49 | |
| 50 | my_future<int> h(); |
nothing calls this directly
no outgoing calls
no test coverage detected