diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index fd516dd..adaac68 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -75,8 +75,8 @@ boost void release() { - if( px_ ) - px_->release(); + if( px_ && px_->release() ) + px_=0; } }; } @@ -134,7 +134,7 @@ boost class exception; - template + template class shared_ptr; namespace @@ -150,7 +150,7 @@ boost virtual shared_ptr get( type_info_ const & ) const = 0; virtual void set( shared_ptr const &, type_info_ const & ) = 0; virtual void add_ref() const = 0; - virtual void release() const = 0; + virtual bool release() const = 0; virtual refcount_ptr clone() const = 0; protected: diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index 1d018c5..a384054 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -43,26 +43,6 @@ namespace boost { -#if !defined( BOOST_EXCEPTION_DISABLE ) - namespace - exception_detail - { - template - void - throw_exception_( E const & x, char const * current_function, char const * file, int line ) - { - throw_exception( - set_info( - set_info( - set_info( - enable_error_info(x), - throw_function(current_function)), - throw_file(file)), - throw_line(line))); - } - } -#endif - #ifdef BOOST_NO_EXCEPTIONS void throw_exception( std::exception const & e ); // user defined @@ -86,6 +66,26 @@ template BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const #endif +#if !defined( BOOST_EXCEPTION_DISABLE ) + namespace + exception_detail + { + template + BOOST_ATTRIBUTE_NORETURN + void + throw_exception_( E const & x, char const * current_function, char const * file, int line ) + { + boost::throw_exception( + set_info( + set_info( + set_info( + enable_error_info(x), + throw_function(current_function)), + throw_file(file)), + throw_line(line))); + } + } +#endif } // namespace boost #endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED