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_SAFE on 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 a std::string named __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, noexcept so 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