std::error_category::operator==,!=,<,<=>
来自cppreference.com
< cpp | error | error category
工具库
诊断库
|
|
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) 检查 *this 与
rhs
是否指代同一对象。2) 检查 *this 与
rhs
是否不指代同一对象。4) 按 this 与
&rhs 的顺序排序
*this 与
rhs
。等价于 std::std::compare_three_way()(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_ordering::less ,否则若按该顺序
rhs
小于 *this 则为 std::strong_ordering::greater ,否则为
std::strong_ordering::equal 。