Debian Codegraph @

yo/coroutines/demo/corodir/promisebase.h

raw
1 #ifndef INCLUDED_PROMISEBASE_H_
2 #define INCLUDED_PROMISEBASE_H_
3
4 class PromiseBase
5 {
6 public:
7 std::suspend_always initial_suspend();
8 std::suspend_always final_suspend() noexcept;
9 [[noreturn]] void unhandled_exception();
10 void return_void();
11 };
12
13 inline std::suspend_always PromiseBase::initial_suspend()
14 {
15 return {};
16 }
17
18 inline std::suspend_always PromiseBase::final_suspend() noexcept
19 {
20 return {};
21 }
22
23 inline void PromiseBase::unhandled_exception()
24 {
25 throw;
26 }
27
28 inline void PromiseBase::return_void()
29 {}
30
31 #endif