std::stop_source:: operator=
From cppreference.net
<
cpp
|
thread
|
stop source
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::stop_source
| Member functions | ||||
|
stop_source::operator=
|
||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
| Helper tags | ||||
|
std::
stop_source
&
operator
=
(
const
std::
stop_source
&
other
)
noexcept
;
|
(1) | (自 C++20 起) |
|
std::
stop_source
&
operator
=
(
std::
stop_source
&&
other
)
noexcept
;
|
(2) | (自 C++20 起) |
将停止状态替换为 other 的状态。
1)
将
other
的停止状态复制赋值给
*
this
。等价于
stop_source
(
other
)
.
swap
(
*
this
)
。
2)
将
other
的停止状态移动赋值给
*
this
。赋值完成后,
*
this
包含
other
原有的停止状态,而
other
不再持有停止状态。等价于
stop_source
(
std
::
move
(
other
)
)
.
swap
(
*
this
)
。
参数
| 其他 | - |
用于共享或获取停止状态的另一个
stop_source
对象
|