名前空間
変種
操作

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

From cppreference.com
 
 
ユーティリティライブラリ
言語サポート
型のサポート (基本型、RTTI)
ライブラリ機能検査マクロ (C++20)
プログラムユーティリティ
可変引数関数
コルーチンサポート (C++20)
契約サポート (C++26)
三方比較
(C++20)
(C++20)(C++20)(C++20)  
(C++20)(C++20)(C++20)

汎用ユーティリティ
関係演算子 (C++20で非推奨)
 
 
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` が同じオブジェクトを参照していないかどうかをチェックします。
3) `this` と `&rhs` の順序によって `*this` と `rhs` を順序付けます。 `std::less<const error_category*>()(this, &rhs)` と同等です。
4) `this` と `&rhs` の順序によって `*this` と `rhs` を順序付けます。 `std::compare_three_way()(this, &rhs)` と同等です。

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

(C++20以降)

[編集] パラメーター

rhs - 比較する `error_category` を指定します。

[編集] 戻り値

1) `*this` と `rhs` が同じオブジェクトを参照している場合は `true`、そうでない場合は `false`。
2) `*this` と `rhs` が同じオブジェクトを参照していない場合は `true`、そうでない場合は `false`。
3) `*this` が、 `this` と `&rhs` の順序によって定義された順序で `rhs` よりも小さい場合は `true`。
4) `*this` が、 `this` と `&rhs` の順序によって定義された順序で `rhs` よりも小さい場合は `std::strong_order::less`、そうでない場合は `rhs` が順序で `*this` よりも小さい場合は `std::strong_order::greater`、それ以外の場合は `std::strong_order::equal`。
English 日本語 中文(简体) 中文(繁體)