std::error_category::operator==,!=,<,<=>
来自 cppreference.cn
< 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。