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
)
と同等です。
4)
thisとrhsをthisと&rhsの順序で比較します。
*
this
と
rhs
を
this
と
&
rhs
の順序で比較します。
std::
compare_three_way
(
)
(
this,
&
rhs
)
と同等です。
|
|
(C++20以降) |
パラメータ
| rhs | - |
比較対象の
error_category
を指定
|
戻り値
1)
true
が返されるのは、
*
this
と
rhs
が同じオブジェクトを参照している場合であり、それ以外の場合は
false
が返されます。
2)
true
を返す条件:
*
this
と
rhs
が同じオブジェクトを参照していない場合。
false
を返す条件:それ以外の場合。
3)
true
を返す条件:
*
this
が
rhs
より小さい場合(この順序は
this
と
&
rhs
によって定義される)
4)
std
::
strong_order
::
less
、
*
this
が
rhs
よりも小さい場合(
this
と
&
rhs
の順序で定義される)。それ以外の場合、
std
::
strong_order
::
greater
、
rhs
が
*
this
よりも小さい場合。それ以外の場合、
std
::
strong_order
::
equal
。