std::error_category::operator==,!=,<,<=,=>
來自 cppreference.com
< cpp | error | error category
bool operator==( const error_category& rhs ) const noexcept; |
(1) | (C++11 起) |
bool operator!=( const error_category& rhs ) const noexcept; |
(2) | (C++11 起) (C++20 前) |
bool operator<( const error_category& rhs ) const noexcept; |
(3) | (C++11 起) (C++20 前) |
std::strong_ordering operator<=>( const error_category& rhs ) const noexcept; |
(4) | (C++20 起) |
比較另一個錯誤類別。
1) 檢查 *this 和 rhs 是否指向同一物件。
2) 檢查 *this 和 rhs 是否不指向同一物件。
運算子 |
(C++20 起) |
[編輯] 引數
rhs | - | 指定要比較的 error_category |
[編輯] 返回值
1) 如果 *this 和 rhs 指向同一物件,則為 true,否則為 false。
2) 如果 *this 和 rhs 不指向同一物件,則為 true,否則為 false。
3) 如果 *this 小於 rhs(由 this 和 &rhs 的順序定義),則為 true。
4) 如果 *this 小於 rhs(由 this 和 &rhs 的順序定義),則為 std::strong_order::less,否則,如果 rhs 小於 *this(在該順序中),則為 std::strong_order::greater,否則為 std::strong_order::equal。