std::error_code:: operator=
From cppreference.net
<
cpp
|
error
|
error code
C++
Utilities library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diagnostics library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::error_code
| Member functions | ||||
|
error_code::operator=
|
||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
|
(until C++20)
(until C++20)
(C++20)
|
||||
| Helper classes | ||||
|
template
<
class
ErrorCodeEnum
>
error_code & operator = ( ErrorCodeEnum e ) noexcept ; |
(1) | (C++11以降) |
|
error_code
&
operator
=
(
const
error_code
&
other
)
=
default
;
|
(2) |
(C++11以降)
(暗黙的に宣言) |
|
error_code
&
operator
=
(
error_code
&&
other
)
=
default
;
|
(3) |
(C++11以降)
(暗黙的に宣言) |
1)
エラーコードと対応するカテゴリを、エラーコード列挙型
e
を表すものに置き換えます。
次と等価です:
*
this
=
make_error_code
(
e
)
。ここで
make_error_code
は
実引数依存の名前探索
によってのみ見つかります。
2,3)
暗黙的に定義されたコピー代入演算子とムーブ代入演算子は、
other
の内容を
*
this
に代入します。
目次 |
パラメータ
| e | - | 構築するエラーコード列挙型 |
| other | - | 代入する別のエラーコード |
戻り値
* this
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 3629 | C++11 |
std::make_error_code
オーバーロードのみが使用されていた
|
ADLで見つかったオーバーロードが使用される |
関連項目
|
別のエラーコードを割り当てる
(公開メンバ関数) |