From 2887a719c88feafd39b22c8029fb0eaa5c37ccc5 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 2 Sep 2008 18:44:05 +0000 Subject: [PATCH] minor diagnostic_information fix. [SVN r48543] --- .../exception/diagnostic_information.hpp | 30 ++++--------------- include/boost/exception/exception.hpp | 14 ++++----- include/boost/exception/info.hpp | 6 ++-- 3 files changed, 15 insertions(+), 35 deletions(-) diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp index 26b299c..c60c9af 100644 --- a/include/boost/exception/diagnostic_information.hpp +++ b/include/boost/exception/diagnostic_information.hpp @@ -30,28 +30,6 @@ boost } return 0; } - - template - std::string - std_exception_diagnostic_information( std::exception const * x, T const & ) - { - if( char const * s=x->what() ) - if( *s ) - return std::string("\nstd::exception::what(): ")+s; - return std::string(); - } - - template - std::string - std_exception_diagnostic_information( void const *, T const & e ) - { -#ifndef BOOST_NO_RTTI - if( std::exception const * x=dynamic_cast(&e) ) - return std_exception_diagnostic_information(x,e); - else -#endif - return std::string(); - } } inline @@ -61,8 +39,10 @@ boost std::ostringstream tmp; tmp << "boost::exception diagnostic information:" -#if !defined(BOOST_NO_RTTI) && !defined(BOOST_NO_TYPEID) - "\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name() +#ifndef BOOST_NO_RTTI + "\nDynamic exception type: " << BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name(); + if( std::exception const * e=dynamic_cast(&x) ) + tmp << "\nstd::exception::what: " << e->what() #endif ; if( boost::shared_ptr f=get_error_info(x) ) @@ -71,7 +51,7 @@ boost tmp << "\nThrow file name: " << *f; if( boost::shared_ptr l=get_error_info(x) ) tmp << "\nThrow file line: " << *l; - if( char const * s=exception_detail::get_diagnostic_information(x) ) + if( char const * s=exception_detail::get_diagnostic_information(x) ) if( *s ) tmp << "\n" << s; return tmp.str(); diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index 970db8b..fdae86a 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -160,13 +160,13 @@ boost template struct get_info; - template <> + template <> struct get_info; - template <> + template <> struct get_info; - template <> + template <> struct get_info; char const * get_diagnostic_information( exception const & ); @@ -313,10 +313,10 @@ boost virtual clone_base const * clone() const = 0; virtual void rethrow() const = 0; - virtual - ~clone_base() throw() - { - } + virtual + ~clone_base() throw() + { + } }; inline diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index 9be1f6a..0823cd2 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -29,9 +29,9 @@ boost { } - ~error_info() throw() - { - } + ~error_info() throw() + { + } value_type const & value() const