std::jthread:: operator=
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
|
jthread::operator=
|
||||
| Observers | ||||
| Operations | ||||
| Stop token handling | ||||
| Non-member functions | ||||
|
std::
jthread
&
operator
=
(
std::
jthread
&&
other
)
noexcept
;
|
(自 C++20 起) | |
如果 * this 仍关联运行中的线程(即 joinable ( ) == true ),则调用 request_stop ( ) 后接 join ( ) 。将 other 的状态赋予 * this ,并将 other 设置为默认构造状态。
在此次调用后, this - > get_id ( ) 等于调用前 other. get_id ( ) 的值,同时关联的停止状态也被转移,且 other 不再代表执行线程也不具有任何停止状态。
参数
| 其他 | - |
要分配给此
jthread
对象的另一个
jthread
对象
|
返回值
* this