std::coroutine_handle<Promise>:: operator=
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 | ||||
|
coroutine_handle::operator=
|
||||
| Conversion | ||||
| Observers | ||||
| Control | ||||
| Promise access | ||||
| Export/import | ||||
| Non-member functions | ||||
| Helper classes | ||||
|
coroutine_handle
&
operator
=
(
std::
nullptr_t
)
noexcept
;
|
(1) | (自 C++20 起) |
|
coroutine_handle
&
operator
=
(
const
coroutine_handle
&
other
)
=
default
;
|
(2) | (自 C++20 起) |
|
coroutine_handle
&
operator
=
(
coroutine_handle
&&
other
)
=
default
;
|
(3) | (自 C++20 起) |
替换底层地址。
1)
将底层地址替换为空指针值。赋值后,
*
this
不再引用任何协程。此赋值运算符未针对特化
std::
coroutine_handle
<
std::
noop_coroutine_promise
>
声明。
2,3)
将底层地址替换为
other
的地址。复制和移动赋值运算符与隐式声明的运算符等效。
参数
| 其他 | - |
另一个用于赋值的
coroutine_handle
|
返回值
* this