std::error_code::operator=
ja.cppreference.net より
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 は 引数依存の名前検索 によってのみ見つかる。
std::is_error_code_enum<ErrorCodeEnum>::value が true である場合にのみオーバーロード解決に参加する。2,3) 暗黙に定義されたコピー代入演算子およびムーブ代入演算子は、
other の内容を *this に代入する。パラメータ
| e | - | 構築するエラーコード列挙型 |
| other | - | 代入する別のエラーコード |
戻り値
* this
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 3629 | C++11 |
std::make_error_code
オーバーロードのみが使用されていた
|
ADLで見つかったオーバーロードが使用される |
関連項目
|
別のエラーコードを割り当てる
(公開メンバ関数) |