std::runtime_error(3cxx)
π std::runtime_error π
okay so welcome to the std::runtime_error(3cxx) page, bestie β manual name folded in right at the top so we don't have to copy the header line like a boring person. this is the group chat briefing on std::runtime_error, and she is one of two subclasses of exception. periodt. π
πΈ NAME πΈ
std::runtime_error β one of two subclasses of exception. lowkey that's the whole name vibe, no cap.
β¨ SYNOPSIS β¨
first, the include, because we love a literal:
#include <stdexcept>
she inherits std::exception.
the iconiques that inherit from her are:
std::chrono::ambiguous_local_timestd::chrono::nonexistent_local_timestd::overflow_errorstd::range_errorstd::regex_errorstd::system_errorstd::underflow_error
π«Ά Public Member Functions π«Ά
runtime_error (const char *) _GLIBCXX_TXN_SAFEβ theconst char *ctor, with_GLIBCXX_TXN_SAFEkept exactly where it belongs. don't drop it, iykyk. π«Άruntime_error (const runtime_error &)=defaultβ copy ctor, defaulted. slay.runtime_error (const string &__arg) _GLIBCXX_TXN_SAFEβ theconst string &__argctor, also carrying_GLIBCXX_TXN_SAFE. yes bestie, both underscores in__argmatter. πruntime_error (runtime_error &&) noexceptβ move ctor, and she'snoexcept. iconic.runtime_error & operator= (const runtime_error &)=defaultβ copy assignment, defaulted.runtime_error & operator= (runtime_error &&) noexceptβ move assignment,noexcept. periodt.virtual const char * what () const noexceptβ the virtualwhat()that'sconst noexcept; main character energy for error messages. π
π« Detailed Description π«
okay so the detailed tea is the same as the NAME: std::runtime_error is one of two subclasses of exception.
runtime errors are the problems that sit outside a program's scope β you can't easily predict them, and generally the only time you can catch them is while the program is actually executing. that's the lore, bestie. no extra spice added. π
π Constructor & Destructor Documentation π
π std::runtime_error::runtime_error (const string & __arg) [explicit] π
takes a character string describing the error. that's it, that's the constructor. she's explicit and she ate. π
π Member Function Documentation π
β virtual const char * std::runtime_error::what () const [virtual], [noexcept] β
returns a C-style character string describing the general cause of the current error (the same string passed to the ctor). no cap, it's literally the same string.
reimplemented from std::exception.
reimplemented in std::filesystem::filesystem_error, and std::experimental::filesystem::v1::filesystem_error. those are the iconiques who override her. π
π Author π
ngl, the "author" is Doxygen: this page was generated automatically by Doxygen for libstdc++ from the source code. not me, not you, not the group chat. π
k bye bestie! source/version: libstdc++; date: not printed on the footer, so I'm not inventing one; page: std::runtime_error(3cxx). stay iconic and don't forget the _GLIBCXX_TXN_SAFE bestie πβ¨
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms