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

2.2 KiB

[thread.stoptoken.syn]

32 Concurrency support library [thread]

32.3 Stop tokens [thread.stoptoken]

32.3.2 Header <stop_token> synopsis [thread.stoptoken.syn]

🔗

namespace std {// [stoptoken.concepts], stop token conceptstemplate<class CallbackFn, class Token, class Initializer = CallbackFn>concept stoppable-callback-for = see below; // exposition onlytemplateconcept stoppable_token = see below; templateconcept unstoppable_token = see below; templateconcept stoppable-source = see below; // exposition only// [stoptoken], class stop_tokenclass stop_token; // [stopsource], class stop_sourceclass stop_source; // no-shared-stop-state indicatorstruct nostopstate_t {explicit nostopstate_t() = default; }; inline constexpr nostopstate_t nostopstate{}; // [stopcallback], class template stop_callbacktemplateclass stop_callback; // [stoptoken.never], class never_stop_tokenclass never_stop_token; // [stoptoken.inplace], class inplace_stop_tokenclass inplace_stop_token; // [stopsource.inplace], class inplace_stop_sourceclass inplace_stop_source; // [stopcallback.inplace], class template inplace_stop_callbacktemplateclass inplace_stop_callback; template<class T, class CallbackFn>using stop_callback_for_t = T::template callback_type;}