std:: operator==,!=,<,<=> (std::error_code)
From cppreference.net
<
cpp
|
error
|
error code
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diagnostics library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::error_code
| Member functions | ||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
|
operator==
operator!=
operator<
operator<=>
(until C++20)
(until C++20)
(C++20)
|
||||
| Helper classes | ||||
|
ヘッダーで定義
<system_error>
|
||
|
bool
operator
==
(
const
std::
error_code
&
lhs,
const std:: error_code & rhs ) noexcept ; |
(1) | (C++11以降) |
|
bool
operator
!
=
(
const
std::
error_code
&
lhs,
const std:: error_code & rhs ) noexcept ; |
(2) |
(C++11以降)
(C++20まで) |
|
bool
operator
<
(
const
std::
error_code
&
lhs,
const std:: error_code & rhs ) noexcept ; |
(3) |
(C++11以降)
(C++20まで) |
|
std::
strong_ordering
operator
<=>
(
const
std::
error_code
&
lhs,
const std:: error_code & rhs ) noexcept ; |
(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) |