命名空间
变体
操作

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

[编辑] 参数

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

[编辑] 返回值

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