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
4
u/tyler1128 Apr 02 '26
I mean, the point of most programs is to continue to execute so they can do things and std::terminate, especially unexpectedly, makes them immediately end. std::terminate has uses in basically saying "nope, I don't know how to handle this error or program state, we are aborting before things get more messed up".