r/cpp • u/User_Deprecated • Jul 11 '26
Propagating exceptions from destructors with std::exception_ptr
https://www.sandordargo.com/blog/2026/07/08/exception_ptr
80
Upvotes
r/cpp • u/User_Deprecated • Jul 11 '26
View all comments
Show parent comment
4
u/Som1Lse Jul 11 '26
I'm not so sure.
Take the examples you gave:
If I was writing a file, and that process file, I don't care about the file being flushed. If anything I probably want it deleted. If I was doing a database transaction I'd probably want it cancelled, not committed. Same with writing to a network; I don't want a garbled packet.
I don't really see what you'd be able to do about a log failure. It seems really odd to cancel something because of a log failure, I doubt the user cares, and you can't exactly log it.