Namespaces
Variants

std:: future_category

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)
(C++11)
future_category
(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
定义于头文件 <future>
const std:: error_category & future_category ( ) noexcept ;
(C++11 起)

获取与future和promise相关错误的静态错误类别对象的引用。该对象需要重写虚函数 error_category :: name ( ) 以返回指向字符串 "future" 的指针。它用于标识在 std::future_error 类型异常中提供的错误代码。

目录

参数

(无)

返回值

对具有未指定运行时类型的静态对象的引用,该类型派生自 std::error_category

示例

参见

标识 future 错误代码
(枚举)
报告与 futures 或 promises 相关的错误
(类)
错误类别的基类
(类)