boostorg / exception

Boost.org exception module
http://boost.org/libs/exception
Boost Software License 1.0
15 stars 46 forks source link

Use enable_current_exception instead of wrapexcept in copy_exception #41

Closed pdimov closed 2 years ago

pdimov commented 2 years ago

Since wrapexcept is an undocumented implementation detail of throw_exception, it's better to not use it here. As enable_current_exception on throw is no longer necessary under C++11 as boost::exception_ptr automatically uses std::exception_ptr when present (https://godbolt.org/z/GPK99jTzY), it's possible to remove this functionality from wrapexcept under C++11 to reduce the codegen footprint of using boost::throw_exception, and this PR makes sure that copy_exception will not be broken by such a future change to wrapexcept.