std::exception::operator=
來自 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++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
LWG 471 | C++98 | 賦值後呼叫 what() 的效果是 實現定義的 |
若動態型別相同,則要求與原先的 what() 相同 |