std::exception::operator=
ja.cppreference.net より
exception& operator=( const exception& other ) throw();
|
(C++11まで) | |
exception& operator=( const exception& other ) noexcept;
|
(C++11以降) (constexpr C++26以降) |
|
コピー代入演算子。other の内容を代入します。
もし *this と other の動的な型が両方とも std::exception であるならば、代入後 std::strcmp(what(), other.what()) == 0 となります。
パラメータ
| other | - | コンテンツを割り当てるための別の例外 |
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 471 | C++98 |
代入後の
what()
呼び出しの効果は
実装定義 |
動的型が同じ場合、元の
what() と同じであることが要求される |