std::error_category:: operator==,!=,<,<=>
From cppreference.net
<
cpp
|
error
|
error category
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diagnostics library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::error_category
| Member functions | ||||
|
error_category::operator==
error_category::operator!=
error_category::operator<
error_category::operator<=>
(until C++20)
(until 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
是否不引用同一对象。
3)
按照
this
和
&
rhs
的地址顺序对
*
this
和
rhs
进行排序。等价于
std::
less
<
const
error_category
*
>
(
)
(
this,
&
rhs
)
。
|
|
(since C++20) |
参数
| rhs | - |
指定要比较的
error_category
|
返回值
1)
true
若
*
this
与
rhs
引用同一对象,
false
否则。
2)
true
若
*
this
与
rhs
未引用同一对象,否则为
false
。
3)
true
如果
*
this
按照
this
与
&
rhs
的排序规则小于
rhs
。
4)
std
::
strong_order
::
less
若
*
this
按
this
与
&
rhs
的排序规则小于
rhs
;否则为
std
::
strong_order
::
greater
若
rhs
在该排序中小于
*
this
;否则为
std
::
strong_order
::
equal
。