命名空间
变体
操作

std::error_category::equivalent

来自 cppreference.cn
 
 
 
 
 
virtual bool equivalent( int code,
                         const std::error_condition& condition ) const noexcept;
(1) (自 C++11 起)
virtual bool equivalent( const std::error_code& code,
                         int condition ) const noexcept;
(2) (自 C++11 起)

检查错误代码是否等价于 *this 所代表的错误类别的错误条件。

1) 等价于 default_error_condition(code) == condition
2) 等价于 *this == code.category() && code.value() == condition

[编辑] 参数

代码 - 指定要比较的错误代码
条件 - 指定要比较的错误条件

[编辑] 返回值

true 如果错误代码等价于 *this 所代表的错误类别的给定错误条件,则为 true,否则为 false