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
6
u/azswcowboy Jul 11 '26
I’m wary. I think the current_exception_ptr is in thread local storage. So if you’re using coroutines that can be resumed on another thread this will be a bad idea. In the 15 years since c++11 has been released I’ve never seen this - maybe it’s just knowledge gap, but maybe there’s something in the standard the author overlooked that makes this questionable?