std::invalid_argument(3cxx)
β¨ std::invalid_argument β¨
okay bestie, welcome to the std::invalid_argument page from the libstdc++ manual β yes, that's the C++ standard library crew, and yes, this is the exception you'll be meeting a LOT π
πΈ NAME πΈ
std::invalid_argument β the vibe-check exception, fr fr
π SYNOPSIS π
#include <stdexcept>
Inherits std::logic_error. That's its whole ancestry situation, periodt.
π Public Member Functions π
invalid_argument (const char *) _GLIBCXX_TXN_SAFEβ builds one of these bad boys from a C-style string, with_GLIBCXX_TXN_SAFEon it π«Άinvalid_argument (const invalid_argument &)=defaultβ copy ctor, and it's=default, so the compiler handles it, no notes β¨invalid_argument (const string &__arg) _GLIBCXX_TXN_SAFEβ same energy but from astd::stringnamed__arg, also_GLIBCXX_TXN_SAFEπinvalid_argument (invalid_argument &&)=defaultβ move ctor,=default, we love a no-effort queen πinvalid_argument & operator= (const invalid_argument &)=defaultβ copy assignment,=defaultπinvalid_argument & operator= (invalid_argument &&)=defaultβ move assignment,=defaultπ¦virtual const char * what () const noexceptβ the little virtual method that tells you what went down,noexceptso it can't throw at you, icon behaviour β
π Detailed Description π
Thrown to report invalid arguments to functions. That's literally it β it's the "bestie, that argument? absolutely not" exception π like when you pass something a function simply cannot deal with, and instead of quietly malfunctioning, the program throws one of these at you. Slay, honestly.
π§ Member Function Documentation π§
π¦ virtual const char * std::logic_error::what () const [virtual], [noexcept], [inherited]
Returns a C-style character string describing the general cause of the current error β and plot twist, it's the same string passed to the ctor π like, whatever you fed into the constructor? that's what comes back out. what() is giving main character energy, honestly.
- Reimplemented from
std::exception - Reimplemented in
std::future_error
iykyk π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. So nobody hand-wrote this, it's a robot doing its little robot thing π€β¨
lowkey a warning for you: this page is auto-generated, so if something looks weird, blame Doxygen, not me π
and that's the whole page bestie, no cap β this was the std::invalid_argument entry from the libstdc++ manual set, brought to you by libstdc++ itself π go forth and throw responsibly π«Ά
π¦ 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