std::exception::what(3)

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

πŸ’– std::exception::what β€” C++ Standard Libary manual πŸ’–

okay so welcome to the manual page for std::exception::what, bestie 🫢 this is the C++ Standard Libary one, and we're about to make the explanatory-string function make sense. no cap.

🌸 NAME 🌸

std::exception::what - std::exception::what

✨ Synopsis ✨

virtual const char* what() const throw();   (until C++11)
virtual const char* what() const noexcept;  (since C++11)

Returns the explanatory string. it's giving explanatory string, and that's the whole job, periodt.

πŸŽ€ Parameters πŸŽ€

(none) β€” literally no parameters, not even one, bestie.

πŸ’… Return value πŸ’…

Pointer to a null-terminated string with explanatory information. The pointer is guaranteed to be valid at least until the exception object from which it is obtained is destroyed, or until a non-const member function on the exception object is called. that's the whole safety window, iykyk.

🩹 Defect reports 🩹

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR: LWG 108
    • Applied to: C++98
    • Behavior as published: it was unspecified when the returned pointer becomes invalid
    • Correct behavior: specified

k that's the tea. source/version: http://cppreference.com; date: 2024.06.10. bye bestie πŸ’–βœ¨

πŸ“¦ where this page comes from