[#bsl-stop_token]
= xref:bsl.adoc[bsl]::stop&lowbar;token
:relfileprefix: ../
:mrdocs:

Mechanism for observing cancellation requests on a stop state&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class stop&lowbar;token;
----

== Description

This class is a mechanism for observing cancellation requests&period; An object of this class either has (possibly shared) ownership of a stop state and can be used to observe whether a cancellation request has been made on that stop state, or does not own a stop state&period; A `stop&lowbar;token` cannot be used to make a cancellation request&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/stop_token/callback_type.adoc[`callback&lowbar;type`] 
| Alias for `stop&lowbar;callback` parameterized by `t&lowbar;CALLBACK`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/stop_token/2constructor-06.adoc[`stop&lowbar;token`]         [.small]#[constructor]#
| Constructors
| xref:bsl/stop_token/2destructor.adoc[`&#126;stop&lowbar;token`] [.small]#[destructor]#
| Destroy this object&period;
| xref:bsl/stop_token/operator_assign-07.adoc[`operator&equals;`] 
| Assignment operators
| xref:bsl/stop_token/stop_possible.adoc[`stop&lowbar;possible`] 
| Return whether a stop is still possible on the referred stop state&period;
| xref:bsl/stop_token/stop_requested.adoc[`stop&lowbar;requested`] 
| Return whether a stop has been requested on the referred stop state&period;
| xref:bsl/stop_token/swap.adoc[`swap`] 
| Exchange the stop states referred to by `&ast;this` and `other`&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/swap-06da.adoc[bsl::swap]`
| Exchange the stop states referred to by `lhs` and `rhs`&period;
| `xref:bsl/operator_eq-0c5.adoc[bsl::operator&equals;&equals;]`
| Return whether `lhs` and `rhs` refer to the same stop state&period;
| `xref:bsl/stop_callback-06.adoc[bsl::stop&lowbar;callback]`
| Callback invoked when a stop is requested on an associated stop state&period;
| `xref:bsl/stop_source.adoc[bsl::stop&lowbar;source]`
| Mechanism for requesting and observing cancellation on a stop state&period;
|===


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