[#bsl-swap-06da]
= xref:bsl.adoc[bsl]::swap
:relfileprefix: ../
:mrdocs:

Set `lhs` to refer to the stop state (or lack thereof) that `rhs` referred to, and vice versa&period; Implementation note&colon; this function is required by the standard to be a hidden friend (&lsqb;hidden&period;friends&rsqb;, &lsqb;stoptoken&period;general&rsqb;)&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;stoptoken&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
swap(
    xref:bsl/stop_token.adoc[stop&lowbar;token]& lhs,
    xref:bsl/stop_token.adoc[stop&lowbar;token]& rhs) noexcept;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
