Documentation Home >> Headers >> <mutex> Header >> std::unique_lock >> swap Non-member function for std::unique_locks

Exchanges ownership of their associated mutex locks between two std::unique_lock objects.

void swap(unique_lock& lhs,unique_lock& rhs);

Effects:

lhs.swap(rhs)

Throws:

Nothing

Header

#include <mutex>

See Also