bsl::swap

Exchange the stop states referred to by lhs and rhs.

Synopsis

Declared in <bslstl_stoptoken.h>

void
swap(
    stop_token& lhs,
    stop_token& rhs) noexcept;

Description

Set lhs to refer to the stop state (or lack thereof) that rhs referred to, and vice versa. Implementation note: this function is required by the standard to be a hidden friend ([hidden.friends], [stoptoken.general]).

Parameters

NameDescription
lhsfirst token participating in the swap
rhssecond token participating in the swap