C++ Thread Library - Function swap


Description

It swaps the state of the object with that of x.

Declaration

Following is the declaration for std::thread::swap function.

void swap (thread& x) noexcept;

C++11

void swap (thread& x) noexcept;

Parameters

x − Thread object whose state is swapped with that of *this.

Return Value

none

Exceptions

No-throw guarantee − never throws exceptions.

Data races

The object is accessed.

thread.htm
Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements