std::is_error_code_enum

定义于头文件 <system_error>
template< class T >
struct is_error_code_enum;
(C++11 起)

T 是错误码枚举,则此模板提供等于 true 的成员常量 value 。对于任何其他类型, valuefalse

此模板可以为用户定义类型特化,以指示该类型适合于 std::error_codestd::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>

参阅

鉴别作为 std::error_condition 的枚举
(类模板)

版本历史

  • (当前 | 先前 2017年8月26日 (六) 20:02Fruderica讨论 | 贡献 . . (944字节) (-1). . (撤销)
  • 当前 | 先前) 2017年5月4日 (四) 05:14Fruderica讨论 | 贡献. . (945字节) (+945). . (以“{{cpp/title|is_error_code_enum}} {{cpp/error/error_code/navbar}} {{dcl begin}} {{dcl header | system_error}} {{dcl | since=c++11 | 1= template< class T > struct is_e...”为内容创建页面)