mirror of
https://github.com/boostorg/exception.git
synced 2025-07-16 05:52:14 +02:00
Borland compatibility for enable_error_info.hpp,
Tabs removed from exception.hpp, Documentation rebound. [SVN r45273]
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#define UUID_0C5D492E909711DCB658AD4556D89593
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
@ -54,12 +55,28 @@ boost
|
||||
typedef error_info_injector<T> type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__,BOOST_TESTED_AT(0x582))
|
||||
template <class T>
|
||||
struct
|
||||
sizeof_dispatch
|
||||
{
|
||||
enum e { value=sizeof(dispatch((T*)0)) };
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_return_type
|
||||
{
|
||||
typedef typename enable_error_info_helper<T,sizeof_dispatch<T>::value>::type type;
|
||||
};
|
||||
#else
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_return_type
|
||||
{
|
||||
typedef typename enable_error_info_helper<T,sizeof(dispatch((T*)0))>::type type;
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
@ -47,45 +47,45 @@ boost
|
||||
{
|
||||
public:
|
||||
|
||||
virtual
|
||||
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();
|
||||
}
|
||||
virtual
|
||||
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();
|
||||
}
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
exception()
|
||||
{
|
||||
}
|
||||
exception()
|
||||
{
|
||||
}
|
||||
|
||||
exception( exception const & e ):
|
||||
data_(e.data_)
|
||||
{
|
||||
}
|
||||
exception( exception const & e ):
|
||||
data_(e.data_)
|
||||
{
|
||||
}
|
||||
|
||||
#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.
|
||||
virtual ~exception() throw()=0;
|
||||
//Force class exception to be abstract.
|
||||
//Otherwise, MSVC bug allows throw exception(), even though the copy constructor is protected.
|
||||
virtual ~exception() throw()=0;
|
||||
#else
|
||||
#if BOOST_WORKAROUND( __GNUC__, BOOST_TESTED_AT(4) )
|
||||
virtual //Disable bogus GCC warning.
|
||||
virtual //Disable bogus GCC warning.
|
||||
#endif
|
||||
~exception() throw()
|
||||
{
|
||||
}
|
||||
~exception() throw()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
@ -103,12 +103,12 @@ boost
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND( BOOST_MSVC, BOOST_TESTED_AT(1500) ) //See above.
|
||||
inline
|
||||
exception::
|
||||
~exception() throw()
|
||||
{
|
||||
}
|
||||
inline
|
||||
exception::
|
||||
~exception() throw()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user