diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index 0be37eb..7a666eb 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -113,16 +113,27 @@ private: ~deleter() { delete p_; } }; +private: + + void copy_from( void const* ) + { + } + + void copy_from( boost::exception const* p ) + { + static_cast( *this ) = *p; + } + public: explicit wrapexcept( E const & e ): E( e ) { - boost::exception_detail::copy_boost_exception( this, &e ); + copy_from( &e ); } explicit wrapexcept( E const & e, boost::source_location const & loc ): E( e ) { - boost::exception_detail::copy_boost_exception( this, &e ); + copy_from( &e ); set_info( *this, throw_file( loc.file_name() ) ); set_info( *this, throw_line( loc.line() ) );