documentation update, added function exception::diagnostic_information, added std::exception to_string overload, removed tabs from source files

[SVN r46697]
This commit is contained in:
Emil Dotchevski
2008-06-25 23:27:56 +00:00
committed by Peter Dimov
parent e8fe47ca4e
commit 6a6f4222ce
2 changed files with 39 additions and 21 deletions

View File

@ -27,7 +27,7 @@ boost
error_info_container:
public exception_detail::counted_base
{
virtual char const * what( std::type_info const & ) const = 0;
virtual char const * diagnostic_information( char const *, std::type_info const & ) const = 0;
virtual shared_ptr<error_info_base const> get( std::type_info const & ) const = 0;
virtual void set( shared_ptr<error_info_base const> const & ) = 0;
};
@ -51,17 +51,14 @@ boost
char const *
what() const throw()
{
if( data_ )
try
{
char const * w = data_->what(typeid(*this));
BOOST_ASSERT(0!=w);
return w;
}
catch(...)
{
}
return typeid(*this).name();
return diagnostic_information();
}
virtual
char const *
diagnostic_information() const throw()
{
return _diagnostic_information(0);
}
protected:
@ -75,6 +72,22 @@ boost
{
}
char const *
_diagnostic_information( char const * std_what ) const throw()
{
if( data_ )
try
{
char const * w = data_->diagnostic_information(std_what,typeid(*this));
BOOST_ASSERT(0!=w);
return w;
}
catch(...)
{
}
return std_what ? std_what : typeid(*this).name();
}
#if BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1500) )
//Force class exception to be abstract.
//Otherwise, MSVC bug allows throw exception(), even though the copy constructor is protected.