Files
2025-10-25 03:02:53 +03:00

12 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[thread.stoptoken.syn]
# 32 Concurrency support library [[thread]](./#thread)
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#syn)
### 32.3.2 Header <stop_token> synopsis [thread.stoptoken.syn]
[🔗](#header:%3cstop_token%3e)
namespace std {// [[stoptoken.concepts]](stoptoken.concepts "32.3.3Stop token concepts"), stop token conceptstemplate<class CallbackFn, class Token, class Initializer = CallbackFn>concept [*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3Stop token concepts[stoptoken.concepts]") = *see below*; // *exposition only*template<class Token>concept [stoppable_token](stoptoken.concepts#concept:stoppable_token "32.3.3Stop token concepts[stoptoken.concepts]") = *see below*; template<class Token>concept [unstoppable_token](stoptoken.concepts#concept:unstoppable_token "32.3.3Stop token concepts[stoptoken.concepts]") = *see below*; template<class Source>concept [*stoppable-source*](stoptoken.concepts#concept:stoppable-source "32.3.3Stop token concepts[stoptoken.concepts]") = *see below*; // *exposition only*// [[stoptoken]](stoptoken "32.3.4Class stop_­token"), class stop_tokenclass stop_token; // [[stopsource]](stopsource "32.3.5Class stop_­source"), class stop_sourceclass stop_source; // no-shared-stop-state indicatorstruct nostopstate_t {explicit nostopstate_t() = default; }; inline constexpr nostopstate_t nostopstate{}; // [[stopcallback]](stopcallback "32.3.6Class template stop_­callback"), class template stop_callbacktemplate<class Callback>class stop_callback; // [[stoptoken.never]](stoptoken.never "32.3.7Class never_­stop_­token"), class never_stop_tokenclass never_stop_token; // [[stoptoken.inplace]](stoptoken.inplace "32.3.8Class inplace_­stop_­token"), class inplace_stop_tokenclass inplace_stop_token; // [[stopsource.inplace]](stopsource.inplace "32.3.9Class inplace_­stop_­source"), class inplace_stop_sourceclass inplace_stop_source; // [[stopcallback.inplace]](stopcallback.inplace "32.3.10Class template inplace_­stop_­callback"), class template inplace_stop_callbacktemplate<class CallbackFn>class inplace_stop_callback; template<class T, class CallbackFn>using stop_callback_for_t = T::template callback_type<CallbackFn>;}