r/cpp • u/pavel_v • Apr 02 '26
What happens when a destructor throws
https://www.sandordargo.com/blog/2026/04/01/when-a-destructor-throws
102
Upvotes
r/cpp • u/pavel_v • Apr 02 '26
View all comments
Show parent comment
2
u/kpt_ageus Apr 02 '26
You use try catch to prevent termination. And your program terminates anyway.
I apologize for sounding high and mighty, rude even, but unless you don't know what std::terminate does I can't imagine how it's not immediately obvious why this is bad.