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
2
u/Remi_Coulom Jul 11 '26
Yes. It may be more convenient to create your file class, and make the transaction function a member, so that you can open the file once, and have multiple transactions in different parts of your code. The transaction would ensure std::fflush is called.