Namespaces
Variants

std::exception:: operator=

From cppreference.net
Utilities library
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 となります。

パラメータ

other - コンテンツを割り当てるための別の例外

不具合報告

以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。

DR 適用対象 公開時の動作 正しい動作
LWG 471 C++98 代入後の what() 呼び出しの効果は
実装定義
動的型が同じ場合、元の
what() と同じであることが要求される