C++ 参考手册
- C++11
 - C++14
 - C++17
 - C++20
 - C++ 编译器支持情况表
 - 独立与宿主实现
 - C++ 语言
 - C++ 关键词
 - 预处理器
 - C++ 标准库头文件
 - 具名要求
 - 功能特性测试 (C++20)
 - 工具库
 - 类型支持(基本类型、RTTI、类型特性)
 - 概念库 (C++20)
 - 错误处理
 - std::exception_ptr
 - std::error_code
 - std::hash<std::error_code>
 - std::is_error_code_enum
 - std::error_code::error_code
 - std::error_code::operator=
 - std::error_code::assign
 - std::error_code::clear
 - std::error_code::value
 - std::error_code::category
 - std::error_code::default_error_condition
 - std::error_code::message
 - std::error_code::operator bool
 - std::operator==,!=,<,<=>(std::error_code)
 - std::operator<<(std::error_code)
 - std::error_condition
 - std::terminate
 - std::exception
 - std::current_exception
 - std::rethrow_exception
 - std::make_exception_ptr
 - std::unexpected
 - std::uncaught_exception, std::uncaught_exceptions
 - assert
 - errno
 - std::nested_exception
 - std::throw_with_nested
 - std::rethrow_if_nested
 - std::terminate_handler
 - std::get_terminate
 - std::set_terminate
 - std::bad_exception
 - std::unexpected_handler
 - std::get_unexpected
 - std::set_unexpected
 - 错误号
 - std::logic_error
 - std::invalid_argument
 - std::domain_error
 - std::length_error
 - std::out_of_range
 - std::runtime_error
 - std::range_error
 - std::overflow_error
 - std::underflow_error
 - std::tx_exception
 - std::error_category
 - std::generic_category
 - std::system_category
 - std::errc
 - std::system_error
 - 注释
 - 动态内存管理
 - 日期和时间工具
 - 字符串库
 - 容器库
 - 迭代器库
 - 范围库 (C++20)
 - 算法库
 - 数值库
 - 输入/输出库
 - 文件系统库
 - 本地化库
 - 正则表达式库
 - 原子操作库
 - 线程支持库
 - 实验性 C++ 特性
 - 有用的资源
 - 索引
 - std 符号索引
 - 协程支持 (C++20)
 - C++ 关键词
 
位置:首页 > C++ 参考手册 >错误处理 >std::error_code > std::is_error_code_enum
std::is_error_code_enum
|   定义于头文件  <system_error>
  | 
||
|   template< class T > struct is_error_code_enum;  | 
(C++11 起) | |
若 T 是错误码枚举,则此模板提供等于 true 的成员常量 value 。对于任何其他类型, value 为 false 。
此模板可以为用户定义类型特化,以指示该类型适合于 std::error_code 及 std::error_condition 自动转换。
标准库的下列类是错误码枚举:
帮助变量模板
|   template< class T > inline constexpr bool is_error_code_enum_v = is_error_code_enum<T>::value;  | 
(C++17 起) | |
继承自 std::integral_constant
成员常量
|    value [静态]  | 
   若 T 是错误码枚举则为 true ,否则为 false  (公开静态成员常量)  | 
成员函数
|    operator bool  | 
   转换对象为 bool ,返回 value  (公开成员函数)  | 
|    operator() (C++14)  | 
   返回 value  (公开成员函数)  | 
成员类型
| 类型 | 定义 | 
  value_type
 | 
  bool
 | 
  type
 | 
std::integral_constant<bool, value> | 
参阅
|    (C++11)  | 
   鉴别枚举是否可作为 std::error_condition  (类模板)  |