Propagating exceptions from destructors with std::exception_ptr

🫧 Open on Bubbles A few weeks ago, I wrote about what happens when a destructor actually throws and why it is a dangerous idea. One of the readers commented that he was once in a situation where he had to propagate an exception from a destructor. But as a destructor cannot safely throw and it also cannot return any value, he needed a better solution. And that solution was std::exception_ptr. Let’s look into wh...

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论