decoupled boost/exception/exception.hpp from boost/exception/detail/type_info.hpp

diagnostic_information improvements
documentation update

[SVN r48469]
This commit is contained in:
Emil Dotchevski
2008-08-30 02:57:12 +00:00
parent e1aba12621
commit 9dd2d64304
15 changed files with 3062 additions and 2888 deletions

View File

@ -6,9 +6,10 @@
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
#define UUID_1A590226753311DD9E4CCF6156D89593
#include <boost/shared_ptr.hpp>
#include <boost/exception/detail/get_boost_exception.hpp>
#include <boost/exception/exception.hpp>
#include <boost/exception/detail/error_info_base.hpp>
#include <boost/exception/detail/type_info.hpp>
#include <boost/shared_ptr.hpp>
namespace
boost
@ -34,16 +35,26 @@ boost
}
}
#ifdef BOOST_NO_RTTI
template <class ErrorInfo>
inline
shared_ptr<typename ErrorInfo::value_type const>
get_error_info( boost::exception const & x )
{
return exception_detail::get_data<ErrorInfo>(x);
}
#else
template <class ErrorInfo,class E>
inline
shared_ptr<typename ErrorInfo::value_type const>
get_error_info( E const & some_exception )
{
if( exception const * x = exception_detail::get_boost_exception(&some_exception) )
if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
return exception_detail::get_data<ErrorInfo>(*x);
else
return shared_ptr<typename ErrorInfo::value_type const>();
}
#endif
}
#endif