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
13
u/PJBoy_ Apr 02 '26
You need to explicitly return if you don't want the exception to be rethrown https://godbolt.org/z/8Wze4Mrr5