std::coroutine_handle<Promise>:: promise
From cppreference.net
<
cpp
|
coroutine
|
coroutine handle
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coroutine support
| 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)
|
std::coroutine_handle
| Member functions | ||||
| Conversion | ||||
| Observers | ||||
| Control | ||||
| Promise access | ||||
|
coroutine_handle::promise
|
||||
| Export/import | ||||
| Non-member functions | ||||
| Helper classes | ||||
|
主模板的成员
|
||
|
Promise
&
promise
(
)
const
;
|
(自 C++20 起) | |
std::coroutine_handle<std::noop_coroutine_promise>
特化的成员
|
||
|
std::
noop_coroutine_promise
&
promise
(
)
const
noexcept
;
|
(自 C++20 起) | |
获取对 promise 对象的引用。
当 * this 未引用尚未销毁其 promise 对象的协程时,行为是未定义的。
此函数未为特化 std:: coroutine_handle <> 提供。
目录 |
参数
(无)
返回值
对 promise 对象的引用。
注释
无操作协程的承诺对象只要存在某个 std::noop_coroutine_handle 引用该协程,就不会被销毁。
参见
|
[静态]
|
从协程的 promise 对象创建
coroutine_handle
(公开静态成员函数) |