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
42
u/pjmlp Apr 02 '26
The author forgot about other alternative, function try blocks.
However they also seem not to work as expected, when applied to destructors, learnt something new today.
https://godbolt.org/z/4r5o5T1sf