std::thread::operator=

< cpp‎ | thread‎ | thread
 
 
线程支持库
线程
(C++11)
(C++20)
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
互斥
(C++11)
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
闩与屏障
(C++20)
(C++20)
future
(C++11)
(C++11)
(C++11)
(C++11)
 
 
thread& operator=( thread&& other ) noexcept;
(C++11 起)

*this 仍拥有关联的运行中进程(即 joinable() == true ),则调用 std::terminate() 。否则,赋值 other 的状态给 *this 并设置 other 为默认构造的状态。

此调用后, this->get_id() 等于 other.get_id() 在调用前的值,而 other 不在表示执行的线程。


参数

other - 赋值给此 thread 对象的另一 thread 对象

返回值

*this