std::bad_ex...n::operator=(3)

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

πŸ’– NAME πŸ’–

std::bad_exception::operator= β€” and yeah, the whole name is literally std::bad_exception::operator=, we're assigning one bad_exception into another, that's the entire gig bestie πŸ’…

this page lives in the C++ Standard Libary manual (section 3, iykyk) πŸ¦‹


✨ SYNOPSIS ✨

okay so there are two flavors of this and which one you get depends on your C++ version, keep up:

until C++11:

bad_exception& operator=( const bad_exception& other ) throw();

since C++11:

bad_exception& operator=( const bad_exception& other ) noexcept;

Assigns the contents of other. simple as that, no cap 🫢

and here's the extra little detail β€” this part is since C++11: if *this and other both have dynamic type std::exception then std::strcmp(what(), other.what()) == 0 after assignment. literally identical vibes after the copy πŸ”₯


πŸŽ€ PARAMETERS πŸŽ€

  • other β€” another bad_exception object to assign πŸ’œ

πŸ‘‘ RETURN VALUE πŸ‘‘

*this. she hands herself right back to you, main character energy only πŸ’…βœ¨


mwah, that's the page bestie! it's from http://cppreference.com, dated 2024.06.10, and the header on this one was trimmed down to std::bad_ex...n::operator=(3) so don't come for me about the ellipsis, that's just how she's filed πŸ“πŸŽ€

πŸ“¦ where this page comes from