std::stop_callback_for_t
来自 cppreference.cn
| 定义于头文件 <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_callback对于std::stop_token的特化,std::inplace_stop_callback对于std::inplace_stop_token的特化,以及- 对于
std::never_stop_token,是不支持停止回调注册和注销的未指定类型。