在线文档教程
C++
应用 | Utilities

std::error_condition

STD:错误[医]条件

Defined in header
class error_condition;(since C++11)

std::error_condition是与平台无关的错误代码。就像std::error_code,则由整数值和std::error_category,但不像std::error_code,该值不依赖于平台。

典型实现包含一个整数数据成员%28值%29和指向std::error_category...

成员函数

(constructor)constructs an error_condition (public member function)
operator=replaces the contents (public member function)
assignreplaces the contents (public member function)
clearsets the error_condition to value 0 in generic_category (public member function)
valueobtains the value of the error_condition (public member function)
categoryobtains the error_category for this error_condition (public member function)
messageobtains the explanatory string (public member function)
operator boolchecks if the value is non-zero (public member function)

非会员职能

operator==operator!=operator<compares error_conditions and error_codes (function)

帮助者类

is_error_condition_enum (C++11)identifies an enumeration as an std::error_condition (class template)
std::hash<std::error_condition> (C++17)hash support for std::error_condition (class template specialization)

另见

error_code (C++11)holds a platform-dependent error code (class)
error_category (C++11)base class for error categories (class)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cpPreference.com/w/cpp/Error/Error[医]条件