名稱空間
變體
操作

std::error_category::equivalent

來自 cppreference.com
 
 
 
 
 
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