std::runtime_error(3)
π std::runtime_error(3) β Library Functions Manual π
okay bestie, pull up a chair, we're talking about std::runtime_error from the libstdc++ library functions manual. she's a whole mood and honestly? she's iconic. let's get into it β¨
πΈ NAME πΈ
std::runtime_error β one of two subclasses of exception. that's it, that's the vibe. one of TWO. she's rare. she's special. π
π SYNOPSIS π
#include <stdexcept_except.h>
she Inherits std::exception. periodt.
she's also Inherited by ,, ,, std::overflow_error, std::range_error, and std::regex_error. yes bestie, those first two are literally blank in the original, that's not me being shady, that's just how the page is fr fr π
β¨ Public Member Functions β¨
runtime_error (const char *)runtime_error (const runtime_error &) noexceptruntime_error (const string &__arg)runtime_error (runtime_error &&) noexceptruntime_error & operator= (const runtime_error &) noexceptruntime_error & operator= (runtime_error &&) noexceptvirtual const char * what () const noexcept
look at that list. ctors, copy ctor, move ctor, copy assign, move assign, and the one and only what(). she's got range, she's got options, she's got main character energy π
π¦ Detailed Description π¦
One of two subclasses of exception. (yes, we said it already, she's proud of it, let her have this π)
Runtime errors represent problems outside the scope of a program; they cannot be easily predicted and can generally only be caught as the program executes.
lowkey this is the important bit bestie: these aren't the "oops i typed it wrong" errors, these are the chaos gremlins that show up while your program is already running and you cannot predict them ahead of time. you can basically only catch them in the moment. no cap. π
π Constructor & Destructor Documentation π
π std::runtime_error::runtime_error (const string & __arg) [explicit]
Takes a character string describing the error. that's the whole job. you hand her a lil string saying what went wrong and she holds onto it like a secret. π
References runtime_error().
Referenced by runtime_error().
not me pointing out that she references herself and is referenced by herself, that's just what the page says, she's self-sufficient, she's independent, she's that girl π
β 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).
so basically: whatever you whispered into the constructor, what() hands it right back to you as a const char *. no drama, no filtering, just the receipts. π«Ά
Reimplemented from std::exception.
Reimplemented in std::experimental::filesystem::v1::filesystem_error, std::filesystem::filesystem_error, and std::ios_base::failure.
References what().
Referenced by what().
okay she's referencing herself again and honestly? self-love. we stan. π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code.
translation: no human wrote this by hand, a robot (Doxygen) did it for libstdc++, and honestly it ate π₯
okay bestie that's the whole page!! short, sweet, and absolutely slaying in her little exception hierarchy. go catch some runtime errors, stay hydrated, and remember: unpredictable problems are just plot twists. πβ¨
libstdc++ made this one, and it's been living in the manual pages ever since β mwah, kisses, see you in the next page, no cap ππ¦π
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms