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。