[#bsl-swap-03fc] = xref:bsl.adoc[bsl]::swap :relfileprefix: ../ :mrdocs: Exchange the stop states referred to by `lhs` and `rhs`. == Synopsis Declared in `<bslstl_stoptoken.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap( xref:bsl/stop_source.adoc[stop_source]& lhs, xref:bsl/stop_source.adoc[stop_source]& rhs) noexcept; ---- [NOTE] ==== This function is a https://en.cppreference.com/w/cpp/language/friend[hidden friend] of xref:bsl/stop_source.adoc[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 [cols="1,4"] |=== | Name| Description | *lhs* | first source participating in the swap | *rhs* | second source participating in the swap |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#