bsl::swap

Exchange the stop states referred to by lhs and rhs.

Synopsis

Declared in <bslstl_stoptoken.h>

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

NOTE

This function is a hidden friend of stop_source, declared only inside that class: it can be found only through argument-dependent lookup.

Description

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

Parameters

NameDescription
lhsfirst source participating in the swap
rhssecond source participating in the swap