std::error_category::operator==,!=,<,<=>
ja.cppreference.net より
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 の順序で順序付けします。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
。