std::logic_error(3cxx)

okay so this is the std::logic_error(3cxx) page from the libstdc++ manual β€” manual name folded in near the top like a little name tag, because we are not copying that header line, bestie 🫢

🌸 NAME 🌸

std::logic_error β€” literally one of two subclasses of exception. That's the whole name-and-title situation, no cap.

✨ SYNOPSIS ✨

#include <stdexcept>

Inherits std::exception. πŸ’…

Inherited by:

  • __gnu_pbds::container_error
  • std::domain_error
  • std::experimental::fundamentals_v1::bad_optional_access
  • std::future_error
  • std::invalid_argument
  • std::length_error
  • std::out_of_range

πŸŽ€ Public Member Functions πŸŽ€

  • logic_error (const char *) _GLIBCXX_TXN_SAFE β€” signature drop, exactly as written; no extra lore attached.
  • logic_error (const logic_error &)=default β€” copy constructor, defaulted, living its best compiler-generated life.
  • logic_error (const string &__arg) _GLIBCXX_TXN_SAFE β€” another constructor signature, verbatim.
  • logic_error (logic_error &&) noexcept β€” move constructor, noexcept and everything.
  • logic_error & operator= (const logic_error &)=default β€” copy assignment, defaulted.
  • logic_error & operator= (logic_error &&) noexcept β€” move assignment, noexcept.
  • virtual const char * what () const noexcept β€” virtual what(), noexcept.

πŸ’– Detailed Description πŸ’–

std::logic_error is one of two subclasses of exception. Periodt.

Logic errors represent problems in the internal logic of a program; in theory, these are preventable, and even detectable before the program runs (e.g., violations of class invariants). That's the whole cautionary tale, bestie β€” no invented extra rules. πŸ¦‹

🧚 Constructor & Destructor Documentation 🧚

std::logic_error::logic_error (const string & __arg) [explicit]

Takes a character string describing the error. That's it β€” the constructor is explicit, and it wants the description string. πŸŽ€

πŸ”₯ Member Function Documentation πŸ”₯

virtual const char * std::logic_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). Yep, it's giving "come get the error tea." β˜•

Reimplemented from std::exception.

Reimplemented in std::future_error.

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.


okay bye bestie 🫢 this is the libstdc++ source/version manual situation, footer title std::logic_error(3cxx), and the date? The original footer doesn't show one, so I'm not inventing a date β€” that would be a logic error, lowkey πŸ˜­πŸ’…

πŸ“¦ where this page comes from