std::suspend_always
出自cppreference.com
在標頭 <coroutine> 定義
|
||
struct suspend_always; |
(C++20 起) | |
suspend_always
是空類,能用於指示 await 表達式始終暫停並且不產生值。
目錄 |
[編輯] 成員函數
await_ready |
指示 await 表達式始終暫停 (公開成員函數) |
await_suspend |
無操作 (公開成員函數) |
await_resume |
無操作 (公開成員函數) |
std::suspend_always::await_ready
constexpr bool await_ready() const noexcept { return false; } |
||
始終返回 false,指示 await 表達式始終暫停。
std::suspend_always::await_suspend
constexpr void await_suspend( std::coroutine_handle<> ) const noexcept {} |
||
不做任何事。
std::suspend_always::await_resume
constexpr void await_resume() const noexcept {} |
||
不做任何事。若使用 suspend_always
則 await 表達式不產生值。
[編輯] 示例
本節未完成 原因:暫無示例 |
[編輯] 參閱
(C++20) |
指示 await 表達式應該決不暫停 (類) |