3
我正在使用Boost exception_ptr
的並注意到rethrow_exception(ptr)
並沒有給我原來的例外。我已經煮熟它歸結爲這樣:Boost rethrow_exception拋出不同類型的異常
struct error : virtual std::exception, virtual boost::exception {};
try {
boost::exception_ptr ptr(boost::copy_exception(error()));
boost::rethrow_exception(ptr);
}
catch(boost::exception& e) {
// e is a boost::exception_detail::clone_impl<error>
}
不宜e
是error
代替clone_impl
類型類型的?
我正在使用Boost 1.49.0。