std::exception::operator=
From cppreference.com
exception& operator=( const exception& other ) throw(); |
(C++11まで) | |
| exception& operator=( const exception& other ) noexcept; |
(C++11以降) (C++26 以降 constexpr) |
|
コピー代入演算子。other の内容を代入します。
もし、*this と other が両方とも動的型 std::exception を持つ場合、代入後には std::strcmp(what(), other.what()) = 0 となります。
[編集] パラメータ
| その他 | - | 内容を代入する別の例外 |
[編集] 不具合報告
以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。
| DR | 適用対象 | 公開された動作 | 正しい動作 |
|---|---|---|---|
| LWG 471 | C++98 | what() を呼び出した後の動作は実装定義です。実装定義 |
元の例外と同じであることが要求されます。 動的型が同じ場合、what() は元の例外と同じです。 |