std::ios_base::failure(3cxx)

πŸ’… std::ios_base::failure β€” like, the 3cxx manual page, bestie

okay so welcome to std::ios_base::failure(3cxx), the page about the exception that shows up when your io is going through it 😭✨ It lives in the <ios> header and, ngl, it's the main character of "something went wrong with io."


🌸 NAME 🌸

std::ios_base::failure β€” these are thrown to indicate problems with io πŸ’–


✨ SYNOPSIS ✨

#include <ios>

Inherits std::exception. That's its whole personality trait, honestly β€” it's a std::exception girlie πŸŽ€

🫢 Public Member Functions

  • failure (const char *__s, const error_code &=error_code{}) β€” constructor #1, takes a C-style string plus an error_code that defaults to error_code{} 🌸
  • failure (const string &__s, const error_code &) noexcept β€” constructor #2, string + error_code, and it's noexcept so she will not be throwing at you twice πŸ’…
  • failure (const string &__str) throw () β€” constructor #3, just the string, marked throw ()
  • error_code code () const noexcept β€” hands you back the error_code, noexcept
  • virtual const char * what () const throw () β€” the classic what(), virtual, const, throw ()

Detailed Description

These are thrown to indicate problems with io. That's it, that's the vibe πŸ”₯

Also like β€” the source says, verbatim: 27.4.2.1.1 Class ios_base::failure. Like, that's literally the standard section number, iconic ✨ iykyk.


πŸ¦‹ Member Function Documentation πŸ¦‹

virtual const char * std::ios_base::failure::what () const [virtual]

Returns a C-style character string describing the general cause of the current error. So when you catch it and you're like "girl what happened", this is the thing you call πŸ’–

Reimplemented from std::exception. She's inheriting the tradition, periodt πŸ‘‘


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. Not me writing it by hand, no cap β€” the robots did that one πŸ€–πŸ’œ


Fr fr, this page ships as part of libstdc++ in the 3cxx man section β€” so when you're RTFM-ing at 2am, that's the source and the section, bestie πŸ«ΆπŸ’– Go read your io errors and slay, mwah πŸŽ€βœ¨
πŸ“¦ where this page comes from