名稱空間
變體
操作

std::error_category::operator==,!=,<,<=,=>

來自 cppreference.com
 
 
 
 
std::error_category
成員函式
error_category::operator==error_category::operator!=error_category::operator<error_category::operator<=>
(直到 C++20)(直到 C++20)(C++20)
 
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) 檢查 *thisrhs 是否指向同一物件。
2) 檢查 *thisrhs 是否不指向同一物件。
3) 根據 this&rhs 的順序,對 *thisrhs 進行排序。等價於 std::less<const error_category*>()(this, &rhs)
4) 根據 this&rhs 的順序,對 *thisrhs 進行排序。等價於 std::compare_three_way()(this, &rhs)

運算子 <<=>>=!= 分別由 operator<=>operator== 合成

(C++20 起)

[編輯] 引數

rhs - 指定要比較的 error_category

[編輯] 返回值

1) 如果 *thisrhs 指向同一物件,則為 true,否則為 false
2) 如果 *thisrhs 不指向同一物件,則為 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