Boost Exception now works with BOOST_NO_RTTI and/or BOOST_NO_TYPEID.

[SVN r48429]
This commit is contained in:
Emil Dotchevski
2008-08-28 23:49:55 +00:00
parent 14765312e2
commit 850b7d9618
20 changed files with 369 additions and 148 deletions

View File

@ -6,7 +6,7 @@
#ifndef UUID_0552D49838DD11DD90146B8956D89593
#define UUID_0552D49838DD11DD90146B8956D89593
#include <boost/exception/exception.hpp>
#include <boost/exception/detail/get_boost_exception.hpp>
#include <exception>
#include <string>
@ -17,10 +17,16 @@ boost
std::string
diagnostic_information( std::exception const & x )
{
if( exception const * be = dynamic_cast<exception const *>(&x) )
if( exception const * be = exception_detail::get_boost_exception(&x) )
return be->diagnostic_information();
else
return std::string("[ what: ") + x.what() + ", type: " + typeid(x).name() + " ]";
return std::string("[ what: ") + x.what() + ", type: "
#if defined(BOOST_NO_RTTI) || defined(BOOST_NO_TYPEID)
"Unknown type deriving from std::exception"
#else
+ typeid(x).name() +
#endif
" ]";
}
}