std::coroutine_handle<Promise>::operator bool
來自 cppreference.com
constexpr explicit operator bool() const noexcept; |
(C++20 起) | |
檢查 *this 是否非空,即 *this 的值是從某個協程的 promise 物件獲得的。等價於 return bool(address());。
如果 Promise
是 std::noop_coroutine_promise,此轉換函式總是返回 true。
[編輯] 引數
(無)
[編輯] 返回值
bool(address()),如果 Promise
是 std::noop_coroutine_promise,則為 true。
[編輯] 參閱
匯出底層地址,即協程背後的指標 (public member function) |