std::coroutine_handle<Promise>::operator bool
来自 cppreference.cn
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。
[编辑] 参见
导出底层地址,即支持协程的指针 (公共成员函数) |