std::exception::operator=(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

✨ 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