Namespaces
Variants

std::error_category:: operator==,!=,<,<=>

From cppreference.net
Utilities 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 ) と同等です。

< <= > >= 、および != 演算子は、それぞれ 合成 され、 operator <=> および operator == から生成されます。

(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