std::coroutine_handle<Promise>:: operator bool
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Coroutine traits | ||||
|
(C++20)
|
||||
| Coroutine handle | ||||
|
(C++20)
|
||||
| No-op coroutines | ||||
|
(C++20)
|
||||
|
(C++20)
|
||||
| Trivial awaitables | ||||
|
(C++20)
|
||||
|
(C++20)
|
||||
| Range generators | ||||
|
(C++23)
|
| Member functions | ||||
| Conversion | ||||
| Observers | ||||
|
coroutine_handle::operator bool
|
||||
| Control | ||||
| Promise access | ||||
| Export/import | ||||
| Non-member functions | ||||
| Helper classes | ||||
|
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
。
参见
|
导出底层地址,即支撑协程的指针
(公开成员函数) |