What Happens When Light Goes Boom? Part 4: What Brad Bradington Is Good For
https://atlas.whatip.xyz/post.php?slug=what-happens-when-light-goes-boom-part-4-what-brad-bradington-is-good-for
<p>Cherenkov radiation isn&#039;t just a beautiful phenomenon
#happens #light #boom #good
What Happens When Light Goes Boom? Part 4: What Brad Bradington Is Good For

Cherenkov radiation isn't just a beautiful phenomenon. It turns up in nuclear reactors, in the upper atmosphere, in gamma ray telescopes on three continents, in a cubic kilometer of Antarctic ice...

What Happens When Light Goes Boom? Part 1: The Scientist Who Stared at a Glow
https://atlas.whatip.xyz/post.php?slug=what-happens-when-light-goes-boom-part-1-the-scientist-who-stared-at-a-glow
Breaking: <p>In 1934
#cherenkov #happens #light #glow
What Happens When Light Goes Boom? Part 1: The Scientist Who Stared at a Glow

In 1934, a Soviet physicist named Pavel Cherenkov shone gamma rays into a bottle of water and noticed a faint blue glow. So had others before him. They all shrugged and moved on. Cherenkov didn't...

What happens when a destructor throws

Recently I wrote about the importance of finding joy in our jobs on The Dev Ladder. Mastery and deep understanding are key elements in finding that joy, especially now that generating code is cheap and increasingly done better by AI than by us. Then a memory surfaced. I frequently ask during interviews — as part of a code review exercise — what happens when a destructor throws. Way too many candidates, even those interviewing for senior positions, cannot answer the question. Most say it’s bad practice, but cannot explain why. Some say the program might terminate. Getting an elaborate answer is rare. I’m not saying it’s a dealbreaker, but it definitely doesn’t help. Let’s see what actually happens. The role of a destructor A destructor is the key to implementing the RAII idiom. RAII matters because after you acquire a resource, things might go south. A function might need to return early, or it might throw. Making sure resources are released is cumbersome, and the cleanest way to achieve it is to wrap both acquisition and release in an object that handles this automatically. But what if the release itself is not successful? Destructors have no return value, so error reporting is limited. Typical options include logging, storing error state, or (discouraged) throwing. Why did I mark throwing an exception discouraged? What happens when an exception is thrown When an exception is thrown, runtime stack unwinding starts. First, automatic objects in the current scope are destroyed in reverse order, with their destructors executed. If another exception is thrown during unwinding, std::terminate is called. If a matching exception handler is found, execution continues there. What if a destructor throws with no other active exception? Let’s start with a simple example where no exception handling is ongoing: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // https://godbolt.org/z/zn9b19jao #include <iostream> struct A { ~A() { std::cout << "Destructor\n"; throw std::runtime_error("boom"); } }; int main() { try { A a; } catch (const std::exception& e) { std::cout << "Caught: " << e.what() << "\n"; } } Let’s go step by step: we enter the try block A a is constructed a’s scope ends and ~A() is called A::~A() throws And then… We have to stop for a second and recall an important rule: Since C++11, destructors are implicitly noexcept(true) unless declared otherwise or a base or member destructor can throw. As an exception would leave our noexcept destructor, the noexcept guarantee is violated, so std::terminate is called. The catch block is never reached. What if we want the destructor to be allowed to throw? Let’s update the example and mark the destructor throwable with noexcept(false): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 // https://godbolt.org/z/KKhErsv6Y #include <iostream> struct A { ~A() noexcept(false) { std::cout << "Destructor\n"; throw std::runtime_error("boom"); } }; int main() { try { A a; } catch (const std::exception& e) { std::cout << "Caught: " << e.what() << "\n"; } } In this case, the exception propagates normally and the catch block intercepts it. So a destructor can throw as long as it’s explicitly marked noexcept(false). I said can, not should. And there’s a critical caveat. What if a destructor throws while another exception is active? What if a destructor throws during stack unwinding? Let’s update our example slightly: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 // https://godbolt.org/z/a1n75Tb4c #include <iostream> struct A { ~A() noexcept(false) { std::cout << "Destructor throwing\n"; throw std::runtime_error("boom"); } }; int main() { try { A a; throw std::runtime_error("original"); } catch (...) { std::cout << "caught\n"; } } Let’s go through what happens step by step: we enter the try block throw std::runtime_error("original") is thrown and stack unwinding starts as part of the unwinding, local objects are destroyed, so A::~A() is called A::~A() throws a second exception while the original is still active — std::terminate() is called This termination is mandated by the C++ standard and no catch block is reached. The rule exists because otherwise the runtime would need to track multiple simultaneous propagations, which would be complex and almost certainly ambiguous. Conclusion When a destructor throws, the outcome depends on context. If no other exception is active and the destructor is explicitly marked noexcept(false), the exception propagates normally and can be caught. But this is the exception — in both senses of the word. Since C++11, destructors are implicitly noexcept(true), so a throwing destructor will call std::terminate by default, bypassing any catch block entirely. The real danger is the second scenario: a destructor throwing while stack unwinding is already in progress. Even with noexcept(false), this always calls std::terminate. You cannot let an exception escape a destructor during unwinding — the standard simply does not allow it. This is why the conventional wisdom holds: destructors should not throw. If resource release fails, the alternatives — logging the error, setting an error flag, or storing the failure state for later inspection — are far safer than propagating exceptions out of a destructor. The noexcept(false) opt-out exists, but it requires careful handling and should only be used when you can guarantee that the destructor is never called during stack unwinding. Have you ever encountered a codebase that threw from destructors deliberately? How was the error handling structured? Connect deeper If you liked this article, please hit on the like button, subscribe to my newsletter and let’s connect on Twitter!

Sandor Dargo’s Blog
“Every one should discover, by experience of every kind, the extent and intention of his own sexual Universe. He must be taught that all roads are equally royal, and that the only question for him is ‘Which road is mine?’ All details are equally likely to be of the essence of his personal plan, all equally ‘right’ in themselves, his own choice of the one as correct as, and independent of, his neighbour’s preference for the other. He must not be ashamed or afraid of being homosexual if he happens to be so at heart; he must not attempt to violate his own true nature because public opinion, or mediaeval morality, or religious prejudice would wish he were otherwise.” https://library.hrmtc.com/2026/03/26/every-one-should-discover-by-experience-of-every-kind-the-extent-and-intention-of-his-own-sexual-universe-he-must-be-taught-that-all-roads-are-equally-royal-and-that-the-only-question-for-him-is/ #afraid #aleisterCrowley #all #allRoads #ashamed #atHeart #attempt #beingHomosexual #book #book220 #choice #correct #details #discover #equallyLikely #equallyRight #equallyRoyal #essence #everyKind #everyOne #experience #extent #happens #inThemselves #independent #intention #liberCCXX #liberLegis #mediaevalMorality #mine #must #mustNot #NewComment #onlyQuestion #other #otherwise #ownSexualUniverse #personalPlan #preference #publicOpinion #quote #religiousPrejudice #should #taught #TheBookOfTheLaw #trueNature #violate #whichRoad #wish

New YouTube video is up!
Give me Butt Gutts | Gorn 2
https://www.youtube.com/watch?v=FO-PK1aCoY0
You won't believe what happens when I get wrecked by Gorn 2's insane arena battles!

#YouTube #gorn #battles #believe #happens

Give me Butt Gutts | Gorn 2

YouTube
Scientists Startled by What Happens When They Point Hubble at Comet
https://atlas.whatip.xyz/post.php?slug=scientists-startled-by-what-happens-when-they-point-hubble-at-comet
"Sometimes the best science happens by accident."
The post Scientists Startled by What Happens When They
#scientists #sometimes #startled #happens
Scientists Startled by What Happens When They Point Hubble at Comet

"Sometimes the best science happens by accident." The post Scientists Startled by What Happens When They Point Hubble at Comet appeared first on Futurism. This is an automatically generated summary. ...

Rare Ramadan event happens in 2026, not again until 2057. See details

https://misryoum.com/us/trending/rare-ramadan-event-happens-in-2026-not-again/

Iraqi Chicken &amp; Rice is a comforting dish, heady with spicesIraqi Chicken &amp; Rice, or Machboos, is a comfort food enjoyed any time, but especially during the holy month of Ramadan in Muslim households.Daylight saving time in the U.S. will...

#Rare #Ramadan #event #happens #2026 #not #again #until #2057 #See #details #US_News_Hub #misryoum_com

Pundit Says XRP Price Could Reach $1,000 By The End Of 2026 If This Happens

https://misryoum.com/us/economy/pundit-says-xrp-price-could-reach-1000-by/

The possibility of a massive surge in the XRP price has been raised again following comments made by financial commentator Jake Claver during an interview on the Paul Barron podcast.  During the discussion, Claver suggested that XRP could eventually move...

#Pundit #Says #XRP #Price #Could #Reach #1000 #The #End #2026 #This #Happens #US_News_Hub #misryoum_com

Pi Coin Price Prediction: Pi Clings onto Crucial Support Level – What Happens Next?

https://misryoum.com/us/markets/pi-coin-price-prediction-pi-clings-onto-crucial/

Pi Network (PI) is holding onto a crucial long-term support at $0.15, a level that could decide whether the altcoin stabilizes or slips into deeper losses.This zone has emerged as the final line of defense for bullish Pi Coin price...

#Coin #Price #Prediction #Clings #onto #Crucial #Support #Level #What #Happens #Next #US_News_Hub #misryoum_com

Pi Coin Price Prediction: Pi Clings onto Crucial Support Level – What Happens Next?

Pi Network (PI) is holding onto a crucial long-term support at $0.15, a level that could decide whether the altcoin stabilizes or slips into deeper

US News Hub