std::exception::operator=(3)
β¨ std::exception::operator=(3) β¨
Manual: C++ Standard Libary β yes bestie, that's the exact spelling from the header, and we are respecting it π
β¨ NAME β¨
std::exception::operator= β that's the name, and the NAME line literally gives you std::exception::operator= - std::exception::operator=. Same name twice, zero notes, iconic. π
β¨ Synopsis β¨
okay so here are the signatures, and the throw() β noexcept timeline is the vibe check:
exception& operator=( const exception& other ) throw(); (until C++11)
exception& operator=( const exception& other ) noexcept; (since C++11)
Copy assignment operator. Assigns the contents of other. That's the whole job. π
If *this and other both have dynamic type std::exception then std::strcmp(what(), other.what()) == 0 after assignment. no cap, that's the exact condition. πΈ
π Parameters π
otherβ another exception to assign the contents of. That's it. One parameter, fully booked and busy. π
π©Ή Defect reports π©Ή
The following behavior-changing defect reports were applied retroactively to previously published C++ standards. retroactive lore? we love to see it π
- DR:
LWG 471 - Applied to:
C++98 - Behavior as published: the effects of calling
what()after assignment are implementation-defined - Correct behavior: required to be the same as the original
what()if the dynamic types are the same
That's the whole page, bestie β source/version/date: http://cppreference.com, 2024.06.10, std::exception::operator=(3). mwah π
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms