std::logic_error(3)

πŸ’… NAME πŸ’…

std::logic_error β€” one of two subclasses of exception. that's it, that's the name, she's giving very specific exception energy πŸ’–


✨ SYNOPSIS ✨

okay bestie, here's the whole cast list, no cap:

#include <stdexcept_except.h>

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, and std::out_of_range. she's a whole ancestor, a dynasty, main character energy fr fr πŸ‘‘

πŸŽ€ Public Member Functions πŸŽ€

  • logic_error (const char *)
  • logic_error (const logic_error &) noexcept
  • logic_error (const string &__arg)
  • logic_error (logic_error &&) noexcept
  • logic_error & operator= (const logic_error &) noexcept
  • logic_error & operator= (logic_error &&) noexcept
  • virtual const char * what () const noexcept

🌸 Detailed Description 🌸

One of two subclasses of exception.

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). like… the code was wrong before you even hit compile-and-run, and honestly? relatable πŸ™ˆ


πŸ¦‹ Constructor & Destructor Documentation πŸ¦‹

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

Takes a character string describing the error. tell her what went wrong, she'll hold onto it πŸ’–

References logic_error().

Referenced by logic_error().


⭐ 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). so like, whatever you handed the constructor? she hands it right back. iconic behaviour, no notes πŸ’…

Reimplemented from std::exception.

Reimplemented in std::future_error.

References what().

Referenced by what().


πŸ‘‘ Author πŸ‘‘

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


and that's the whole page, bestie!! 🫢 this was auto-generated by Doxygen for libstdc++ (that's the source/version situation β€” it's a libstdc++ joint, section 3 of the manual, std::logic_error), so go forth, throw her responsibly, and remember: logic errors were preventable, the compiler told you so, and yet. here we are. πŸ’€βœ¨

πŸ“¦ 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.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms