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/Som1Lse Jul 11 '26
Kind of, but it's experimental, and thus not portable. Also, with
std::unique_ptr, you can create an alias a lausing unique_file = std::unique_ptr<std::FILE, file_deleter>;and reuse it, which makes for a very simple RAII wrapper around astd::FILE.