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)
(constexpr начиная с C++26)

Оператор копирующего присваивания. Присваивает содержимое other .

Если * this и other оба имеют динамический тип std::exception , то после присваивания std:: strcmp ( what ( ) , other. what ( ) ) == 0 .

Параметры

other - другое исключение для присвоения содержимого

Отчеты о дефектах

Следующие отчеты об изменениях поведения, влияющие на дефекты, были применены ретроактивно к ранее опубликованным стандартам C++.

DR Applied to Behavior as published Correct behavior
LWG 471 C++98 the effects of calling what() after
assignment are implementation-defined
required to be the same as the original
what() if the dynamic types are the same