std::experi...ope_success(3)
okay so bestie, welcome to the std::experi...ope_success(3) page from the C++ Standard Libary man page β yes, that's the manual name, typo and all π
this is the std::experimental::scope_success destructor and she is very specific about when she fires.
β¨ NAME β¨
std::experimental::scope_success::~scope_success β std::experimental::scope_success::~scope_success π
π¦ Synopsis π¦
The destructor signature is literally this, bestie:
~scope_success() noexcept(noexcept(std::declval<EF&>()()));
It's tagged (library fundamentals TS v3) πΈ
Here's the vibe: it calls the exit function if the result of std::uncaught_exceptions() is less than or equal to the counter of uncaught exceptions (typically on normal exit) and the scope_success is active. Then it destroys the stored EF (if it is a function object) and any other non-static data members. periodt. π
π Exceptions π
Throws any exception thrown by calling the exit function. no cap π
π Notes π
Whether the destructor is called on stack unwinding can be detected by the comparison of the result of std::uncaught_exceptions() and the counter of uncaught exceptions in the scope_success. π¦
Unlike other classes or class template specializations in the C++ standard library and other C++ TR/TS's, scope_success's destructor is permitted to throw an exception. Yes, really β she's built different πβ¨
π See also π
releasemakes thescope_successinactive (public member function) β iconic little switch-up π
This adorable little page came from http://cppreference.com, dated 2024.06.10 β that's the source and date from the footer, bestie, and yes the whole thing is giving C++ Standard Libary energy π«Άπ
πΈ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms