std::operator==,!=,<,<=>(std::error_code)
ja.cppreference.net より
| ヘッダ <system_error>
|
||
bool operator==( const std::error_code& lhs,
const std::error_code& rhs ) noexcept;
|
で定義 | (1) |
bool operator!=( const std::error_code& lhs,
const std::error_code& rhs ) noexcept;
|
(C++11以上) | (2) (C++11以上) |
bool operator<( const std::error_code& lhs,
const std::error_code& rhs ) noexcept;
|
(C++20まで) | (3) (C++11以上) |
std::strong_ordering operator<=>( const std::error_code& lhs,
const std::error_code& rhs ) noexcept;
|
(C++20まで) | (4) |
(C++20以上)
2つのエラーコードオブジェクトを比較します。
1)
lhs rhs と が等しいかどうか比較します。2)
lhs rhs と が等しいかどうか比較します。3)
lhs rhs が より小さいかどうか調べます。4)
lhs rhs と |
の三方比較結果を取得します。 |
(C++20以上) |
パラメータ
| lhs, rhs | - | 比較するエラーコード |
戻り値
1)
true
エラーカテゴリとエラー値が等しい場合。
2)
true
エラーカテゴリまたはエラー値の比較が等しくない場合。
3)
true
が
lhs.
category
(
)
<
rhs.
category
(
)
の場合。それ以外の場合、
true
が
lhs.
category
(
)
==
rhs.
category
(
)
&&
lhs.
value
(
)
<
rhs.
value
(
)
の場合。それ以外の場合、
false
。
4)
lhs.
category
(
)
<=>
rhs.
category
(
)
それが
std
::
strong_ordering
::
equal
でない場合。それ以外の場合、
lhs.
value
(
)
<=>
rhs.
value
(
)
。
関連項目
|
このerror_codeのerror_categoryを取得する
(public member function) |
|
error_code
の値を取得する
(public member function) |
|
|
(removed in C++20)
(removed in C++20)
(C++20)
|
error_condition
と
error_code
を比較する
(function) |