Namespaces
Variants

std:: stop_callback_for_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>
template < class T, class CallbackFn >
using stop_callback_for_t = T :: template callback_type < CallbackFn > ;
(C++26 起)

别名模板 stop_callback_for_t 用于获取类型 T 对应的停止回调类型。

注释

对于标准停止令牌类型和任何有效的 CallbackFn ,对应的 stop_callback_for_t 为:

  • 针对 std:: stop_token std:: stop_callback 特化版本,
  • 针对 std :: inplace_stop_token std :: inplace_stop_callback 特化版本,以及
  • 针对 std :: never_stop_token 的未指定类型(不包含可停止回调的注册与注销功能)。