C++ Thread Library - Function operator=


Advertisements

Description

It is used to move-assign thread.

Declaration

Following is the declaration for std::thread::operator= function.

thread& operator= (thread&& rhs) noexcept;	
thread& operator= (const thread&) = delete;

C++11

thread& operator= (thread&& rhs) noexcept;	
thread& operator= (const thread&) = delete;

Parameters

rhs − It is a othread object.

Return Value

It returns *this.

Exceptions

No-throw guarantee − never throws exceptions.

Data races

Both rhs and the object are modified.

thread.htm
Advertisements