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/fluorihammastahna Apr 02 '26
The stack trace is a very good point. I think I may be using that in the future about when to use exceptions and std::expected: if I care about where it happened it should be the first one, if I don't it should be the second one.
Interesting thought.