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
12
u/pjmlp Apr 02 '26
Yeah, these kind of gotchas is what makes many languages after a certain point really hard to master.
Note that inside the body it isn't the same semantics, this syntax is for when an exception is thrown when setting up the stack frame or the cleaning actions afterwards, including the body as well.
If asked on an interview I would mention I know C++ well enough to write native library bindings for consumption and that is about it.