Namespaces
Variants

std:: nostopstate, std:: nostopstate_t

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
定义于头文件 <stop_token>
struct nostopstate_t { explicit nostopstate_t ( ) = default ; } ;
(1) (C++20 起)
inline constexpr std:: nostopstate_t nostopstate { } ;
(2) (C++20 起)
1) 用于在 std::stop_source 非默认构造函数中作为占位符的空标签类型,该构造函数会使构造的 std::stop_source 成为空对象且不关联任何停止状态。
2) 用于构造空 std::stop_source std::nostopstate_t 对应常量对象实例,在非默认构造函数中作为占位符值使用。

参见

表示停止一个或多个 std::jthread 请求的类
(类)