---
name: "std::stop_token"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::stop_token"
---

# std::stop\_token(3cxx)

Allow testing whether a stop request has been made on a stop\_source.

## NAME

std::stop\_token - Allow testing whether a stop request has been made on a `stop_source`.

## SYNOPSIS

`#include <stop_token>`

### Public Member Functions

**stop\_token** (const **stop\_token** &) noexcept=**default**\
 **stop\_token** (**stop\_token** &&) noexcept=**default**\
 **stop\_token** & **operator=** (const **stop\_token** &) noexcept=**default**\
 **stop\_token** & **operator=** (**stop\_token** &&) noexcept=**default**\
 bool **stop\_possible** () const noexcept\
 bool **stop\_requested** () const noexcept\
 **void** **swap** (**stop\_token** &**\_\_rhs**) noexcept\

### Friends

bool **operator==** (const **stop\_token** &\_\_a, const **stop\_token** &\_\_b)\
 template\<**typename** \_Callback \> **class** **stop\_callback**\
 **class** **stop\_source**\
 **void** **swap** (**stop\_token** &**\_\_lhs**, **stop\_token** &**\_\_rhs**) noexcept\

## Detailed Description

Allow testing whether a stop request has been made on a `stop_source`.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
