operator==,!=,<,<=> (std::error_condition)
From cppreference.net
<
cpp
|
error
|
error condition
|
ヘッダーで定義
<system_error>
|
||
|
bool
operator
==
(
const
std::
error_condition
&
lhs,
const std:: error_condition & rhs ) noexcept ; |
(1) | (C++11以降) |
|
bool
operator
!
=
(
const
std::
error_condition
&
lhs,
const std:: error_condition & rhs ) noexcept ; |
(2) |
(C++11以降)
(C++20まで) |
|
bool
operator
<
(
const
std::
error_condition
&
lhs,
const std:: error_condition & rhs ) noexcept ; |
(3) |
(C++11以降)
(C++20まで) |
|
std::
strong_ordering
operator
<=>
(
const
std::
error_condition
&
lhs,
const std:: error_condition & rhs ) noexcept ; |
(4) | (C++20以降) |
|
bool
operator
==
(
const
std::
error_code
&
code,
const std:: error_condition & cond ) noexcept ; |
(5) | (C++11以降) |
|
bool
operator
==
(
const
std::
error_condition
&
cond,
const std:: error_code & code ) noexcept ; |
(5) |
(C++11以降)
(C++20まで) |
|
bool
operator
!
=
(
const
std::
error_code
&
code,
const std:: error_condition & cond ) noexcept ; |
(6) |
(C++11以降)
(C++20まで) |
|
bool
operator
!
=
(
const
std::
error_condition
&
cond,
const std:: error_code & code ) noexcept ; |
(6) |
(C++11以降)
(C++20まで) |
2つのエラー条件を比較します。
1)
lhs
と
rhs
が等しいかどうかをチェックします。
2)
lhs
と
rhs
が等しくないかどうかをチェックします。
3)
lhs
が
より小さい
かどうかを
rhs
と比較してチェックします。
4)
lhs
と
rhs
の三方比較結果を取得する。
5)
code
が
cond
と意味的に一致するかどうかをチェックします。
6)
code
が
cond
のセマンティックマッチでないかどうかをチェックします。
|
|
(C++20以降) |
パラメータ
| lhs, rhs, cond | - | 比較するエラー条件 |
| code | - | 比較するエラーコード |
戻り値
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
(
)
。
5)
true
が返される条件:
code.
category
(
)
.
equivalent
(
code.
value
(
)
, cond
)
または
cond.
category
(
)
.
equivalent
(
code, cond.
value
(
)
)
のいずれかが真の場合。
6)
true
が返される条件:
code.
category
(
)
.
equivalent
(
code.
value
(
)
, cond
)
も
cond.
category
(
)
.
equivalent
(
code, cond.
value
(
)
)
もtrueでない場合。
関連項目
|
[virtual]
|
error_code
と
error_condition
の等価性を比較
(
std::error_category
の仮想公開メンバ関数)
|
|
(C++20で削除)
(C++20で削除)
(C++20)
|
2つの
error_code
を比較
(関数) |