__GNU_CXX::RECURSIVE_INIT_ERROR(3)
β¨ NAME β¨
__gnu_cxx::recursive_init_error β the exception that gets thrown by __cxa_guard_acquire π
π¦ SYNOPSIS π¦
#include <cxxabi.h>
Inherits std::exception. Bestie, it's literally in the family tree π
π Public Member Functions
virtual constexpr const char * what () const noexceptβ the one (1) member function it brings to the party β¨
πΈ Detailed Description πΈ
okay so. This is the exception thrown by __cxa_guard_acquire π«Ά no cap.
Here's the lore, straight from the standard, C++ 2011 6.7 [stmt.dcl]/4: If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined. π like... undefined. the scariest two words in the whole language, fr fr.
And the vibe is: since we already have a library function to handle locking, we might as well check for this situation and throw an exception π Because sitting there in undefined-behavior limbo is NOT the move.
So how does it even know? We use the second byte of the guard variable to remember that we're in the middle of an initialization π iconic little bookkeeping tbh. The guard variable is keeping receipts π
π Member Function Documentation π
β virtual constexpr const char * std::exception::what () const [inline], [constexpr], [virtual], [noexcept], [inherited]
Returns a C-style character string describing the general cause of the current error π That's it, that's the whole job. C-style string, general cause, you get the gist.
Reimplemented in std::bad_alloc, std::bad_cast, std::bad_exception, std::bad_function_call, std::bad_typeid, std::bad_weak_ptr, std::experimental::filesystem::v1::filesystem_error, std::experimental::fundamentals_v1::bad_any_cast, std::filesystem::filesystem_error, std::future_error, std::ios_base::failure, std::logic_error, and std::runtime_error. π
Like, the whole extended squad reimplemented it. main character energy from every single one of them, and honestly? deserved π
π Author π
Generated automatically by Doxygen for libstdc++ from the source code π€β¨
and that's the whole page bestie!! π¦ this diva of a manual page came to you courtesy of libstdc++, filed under __gnu_cxx:..._init_error(3) β go forth and never recursively re-enter your initializations πππ«Ά
π¦ 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
- centos-stream 10: gcc-toolset-16-libstdc++-docs 16.2.1-1.3.el10 Β· 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