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/tyler1128 Apr 02 '26
It was, the movement of more functional types like that into the rest of the programming space is relatively recent. Rust in particular was inspired by Haskell and especially OCaml. C++ has been inspired by Rust. I've not had a lot of experience with std::expected, though Rust has syntactic features to make its version pretty easy to work with like the ? operator. Even then, you often lose things like stack traces that exceptions can give you.