forked from boostorg/throw_exception
fixed compile errors, removed tabs as required.
[SVN r44114]
This commit is contained in:
committed by
Peter Dimov
parent
db3574bc9d
commit
f371a6f29d
@ -12,79 +12,79 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
boost
|
boost
|
||||||
{
|
{
|
||||||
template <class T>
|
template <class T>
|
||||||
class shared_ptr;
|
class shared_ptr;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
exception_detail
|
exception_detail
|
||||||
{
|
{
|
||||||
class error_info_base;
|
class error_info_base;
|
||||||
|
|
||||||
struct
|
struct
|
||||||
error_info_container:
|
error_info_container:
|
||||||
public exception_detail::counted_base
|
public exception_detail::counted_base
|
||||||
{
|
{
|
||||||
virtual char const * what( std::type_info const & ) const = 0;
|
virtual char const * what( std::type_info const & ) const = 0;
|
||||||
virtual shared_ptr<error_info_base const> get( 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;
|
virtual void set( shared_ptr<error_info_base const> const & ) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Tag,class T>
|
template <class Tag,class T>
|
||||||
class error_info;
|
class error_info;
|
||||||
|
|
||||||
template <class E,class Tag,class T>
|
template <class E,class Tag,class T>
|
||||||
E const & operator<<( E const &, error_info<Tag,T> const & );
|
E const & operator<<( E const &, error_info<Tag,T> const & );
|
||||||
|
|
||||||
template <class ErrorInfo,class E>
|
template <class ErrorInfo,class E>
|
||||||
shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & );
|
shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & );
|
||||||
|
|
||||||
class
|
class
|
||||||
exception
|
exception
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual ~exception() throw()=0;
|
virtual ~exception() throw()=0;
|
||||||
virtual char const * what() const throw();
|
virtual char const * what() const throw();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
shared_ptr<exception_detail::error_info_base const> get( std::type_info const & ) const;
|
shared_ptr<exception_detail::error_info_base const> get( std::type_info const & ) const;
|
||||||
void set( shared_ptr<exception_detail::error_info_base const> const & ) const;
|
void set( shared_ptr<exception_detail::error_info_base const> const & ) const;
|
||||||
|
|
||||||
template <class E,class Tag,class T>
|
template <class E,class Tag,class T>
|
||||||
friend E const & operator<<( E const &, error_info<Tag,T> const & );
|
friend E const & operator<<( E const &, error_info<Tag,T> const & );
|
||||||
|
|
||||||
template <class ErrorInfo,class E>
|
template <class ErrorInfo,class E>
|
||||||
friend shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & );
|
friend shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & );
|
||||||
|
|
||||||
intrusive_ptr<exception_detail::error_info_container> mutable data_;
|
intrusive_ptr<exception_detail::error_info_container> mutable data_;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline
|
inline
|
||||||
exception::
|
exception::
|
||||||
~exception() throw()
|
~exception() throw()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
char const *
|
char const *
|
||||||
exception::
|
exception::
|
||||||
what() const throw()
|
what() const throw()
|
||||||
{
|
{
|
||||||
if( data_ )
|
if( data_ )
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
char const * w = data_->what(typeid(*this));
|
char const * w = data_->what(typeid(*this));
|
||||||
BOOST_ASSERT(0!=w);
|
BOOST_ASSERT(0!=w);
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
return typeid(*this).name();
|
return typeid(*this).name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user