std::bad_optional_access(3cxx)

hey bestie, welcome to the std::bad_optional_access(3cxx) manual page. let's get into it πŸ’–

πŸ‘‘ NAME πŸ‘‘

std::bad_optional_access β€” Exception class thrown when a disengaged optional object is dereferenced. that's the name, that's the whole plot πŸ’…

✨ SYNOPSIS ✨

okay so to even get this class in your life, you include:

#include <optional>

and the inheritance situation is:

Inherits std::exception.

periodt.

πŸŽ€ Public Member Functions πŸŽ€

  • const char * what () const noexcept override β€” this is the public member function, and it's giving main character energy.

🌸 DETAILED DESCRIPTION 🌸

Exception class thrown when a disengaged optional object is dereferenced. lowkey that's the whole detailed description. it's the "you dereferenced an optional that isn't engaged" exception. no cap.

πŸ’… MEMBER FUNCTION DOCUMENTATION πŸ’…

here's the signature, copied exactly, bestie:

   const char * std::bad_optional_access::what () const [inline],  [override],
       [virtual],  [noexcept]

Returns a C-style character string describing the general cause of the current error.

Reimplemented from std::exception.

πŸ’– AUTHOR πŸ’–

Generated automatically by Doxygen for libstdc++ from the source code.


bestie, this page came from the libstdc++ manual, page std::bad_optional_access(3cxx). The footer doesn't give a date, just libstdc++ and std::bad_optional_access(3cxx), so that's the whole sign-off. periodt πŸ’œ