__gnu_cxx::recursive_init_error(3cxx)

πŸ’… NAME

__gnu_cxx::recursive_init_error β€” the exception that __cxa_guard_acquire throws, bestie. That's it, that's the whole vibe.


✨ SYNOPSIS ✨

Inherits std::exception. Yeah, it's part of the family. 🫢

🌸 Public Member Functions

  • virtual const char * what () const noexcept β€” the one (1) member function, and honestly she ate.

πŸ¦‹ Detailed Description πŸ¦‹

Okay so picture this: an exception thrown by __cxa_guard_acquire. That's the whole gig. Main character energy. πŸ‘‘

Now for the lore, and bestie this part is serious β€” straight from C++ 2011 6.7 [stmt.dcl]/4:

If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined.

πŸ’€ undefined πŸ’€ like not "kinda weird" undefined, like actually undefined, so pay attention.

Since we already have a library function to handle locking, we might as well check for this situation and throw an exception. Lowkey genius. We use the second byte of the guard variable to remember that we're in the middle of an initialization. Memory trick, iykyk. ✨

Oh and for the record: Definition at line 704 of file cxxabi.h. She lives there. πŸŽ€


πŸ’– Member Function Documentation πŸ’–

🌈 virtual const char* std::exception::what () const [virtual], [noexcept], [inherited]

Returns a C-style character string describing the general cause of the current error. That's literally what it does, no notes. πŸ“

Note the [inherited] β€” she's not original here, she got it from std::exception and she's slaying with it anyway.

Reimplemented in β€” buckle up, this is a long list and every single one of them is iconic in her own way:

  • std::bad_optional_access
  • std::bad_typeid
  • std::bad_cast
  • std::bad_exception
  • std::runtime_error
  • std::logic_error
  • std::future_error
  • std::experimental::filesystem::v1::filesystem_error
  • std::experimental::fundamentals_v1::bad_any_cast
  • std::bad_function_call
  • std::bad_weak_ptr
  • std::filesystem::filesystem_error
  • std::bad_any_cast
  • std::bad_alloc
  • and std::ios_base::failure

Not me listing fifteen exceptions πŸ’€ but every one of them said "I'll have what she's having."


🧚 Author 🧚

Generated automatically by Doxygen for libstdc++ from the source code. No human wrote this, a robot did, and honestly? It understood the assignment.


okay that's the whole page, go forth and don't recursively re-enter your variable declarations πŸ’œπŸ¦‹βœ¨

libstdc++ Β· Sat Mar 19 β€” that's the version and date right there, mwah, bye bestie πŸŽ€πŸ’…

πŸ“¦ where this page comes from