#include <boost/exception/diagnostic_information.hpp>
+
Returns:
A string value that contains varying amount of implementation-specific diagnostic information about the passed object:
- If E can be statically converted to boost::exception, the returned value contains the string representations of all error_info objects stored in the boost::exception through operator<<, along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string.
-- Otherwise, if E can be statically converted std::exception:
- if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::exception;
+- Otherwise, if E can be statically converted to std::exception:
- if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::exception;
- otherwise the returned value contains the what() string.
diff --git a/include/boost/exception/all.hpp b/include/boost/exception/all.hpp
index c47738b..9ffe42a 100644
--- a/include/boost/exception/all.hpp
+++ b/include/boost/exception/all.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593
#define UUID_316FDA946C0D11DEA9CBAE5255D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
#include
@@ -24,4 +30,7 @@
#include
#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/current_exception_cast.hpp b/include/boost/exception/current_exception_cast.hpp
index 228b6ea..af2f153 100644
--- a/include/boost/exception/current_exception_cast.hpp
+++ b/include/boost/exception/current_exception_cast.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_7E83C166200811DE885E826156D89593
#define UUID_7E83C166200811DE885E826156D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
namespace
boost
@@ -31,4 +37,7 @@ boost
}
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/detail/attribute_noreturn.hpp b/include/boost/exception/detail/attribute_noreturn.hpp
index 1cb0763..f6a0b59 100644
--- a/include/boost/exception/detail/attribute_noreturn.hpp
+++ b/include/boost/exception/detail/attribute_noreturn.hpp
@@ -6,9 +6,7 @@
#ifndef UUID_61531AB0680611DEADD5846855D89593
#define UUID_61531AB0680611DEADD5846855D89593
-#include
-
-#if defined(BOOST_MSVC)
+#if defined(_MSC_VER)
#define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn)
#elif defined(__GNUC__)
#define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn))
diff --git a/include/boost/exception/detail/error_info_impl.hpp b/include/boost/exception/detail/error_info_impl.hpp
index a25d066..32113b1 100644
--- a/include/boost/exception/detail/error_info_impl.hpp
+++ b/include/boost/exception/detail/error_info_impl.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_CE6983AC753411DDA764247956D89593
#define UUID_CE6983AC753411DDA764247956D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
@@ -24,7 +30,6 @@ boost
protected:
- virtual
~error_info_base() throw()
{
}
@@ -64,4 +69,7 @@ boost
};
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/detail/exception_ptr.hpp b/include/boost/exception/detail/exception_ptr.hpp
new file mode 100644
index 0000000..78db17c
--- /dev/null
+++ b/include/boost/exception/detail/exception_ptr.hpp
@@ -0,0 +1,490 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
+
+//Distributed under the Boost Software License, Version 1.0. (See accompanying
+//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef UUID_618474C2DE1511DEB74A388C56D89593
+#define UUID_618474C2DE1511DEB74A388C56D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
+
+#include
+#ifdef BOOST_NO_EXCEPTIONS
+#error This header requires exception handling to be enabled.
+#endif
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace
+boost
+ {
+#ifndef BOOST_NO_RTTI
+ typedef error_info original_exception_type;
+
+ inline
+ std::string
+ to_string( original_exception_type const & x )
+ {
+ return x.value()->name();
+ }
+#endif
+
+ class exception_ptr;
+ exception_ptr current_exception();
+ void rethrow_exception( exception_ptr const & );
+
+ class
+ exception_ptr
+ {
+ typedef bool exception_ptr::*unspecified_bool_type;
+ friend exception_ptr current_exception();
+ friend void rethrow_exception( exception_ptr const & );
+
+ shared_ptr c_;
+ bool bad_alloc_;
+
+ struct
+ bad_alloc_tag
+ {
+ };
+
+ explicit
+ exception_ptr( bad_alloc_tag ):
+ bad_alloc_(true)
+ {
+ }
+
+ explicit
+ exception_ptr( shared_ptr const & c ):
+ c_(c),
+ bad_alloc_(false)
+ {
+ BOOST_ASSERT(c);
+ }
+
+ void
+ rethrow() const
+ {
+ BOOST_ASSERT(*this);
+ if( bad_alloc_ )
+ throw enable_current_exception(std::bad_alloc());
+ else
+ c_->rethrow();
+ }
+
+ bool
+ empty() const
+ {
+ return !bad_alloc_ && !c_;
+ }
+
+ public:
+
+ exception_ptr():
+ bad_alloc_(false)
+ {
+ }
+
+ ~exception_ptr() throw()
+ {
+ }
+
+ operator unspecified_bool_type() const
+ {
+ return empty() ? 0 : &exception_ptr::bad_alloc_;
+ }
+
+ friend
+ bool
+ operator==( exception_ptr const & a, exception_ptr const & b )
+ {
+ return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_;
+ }
+
+ friend
+ bool
+ operator!=( exception_ptr const & a, exception_ptr const & b )
+ {
+ return !(a==b);
+ }
+ };
+
+ class
+ unknown_exception:
+ public exception,
+ public std::exception,
+ public exception_detail::clone_base
+ {
+ public:
+
+ unknown_exception()
+ {
+ }
+
+ explicit
+ unknown_exception( std::exception const & e )
+ {
+ add_original_type(e);
+ }
+
+ explicit
+ unknown_exception( boost::exception const & e ):
+ boost::exception(e)
+ {
+ add_original_type(e);
+ }
+
+ ~unknown_exception() throw()
+ {
+ }
+
+ private:
+
+ exception_detail::clone_base const *
+ clone() const
+ {
+ return new unknown_exception(*this);
+ }
+
+ void
+ rethrow() const
+ {
+ throw*this;
+ }
+
+ template
+ void
+ add_original_type( E const & e )
+ {
+#ifndef BOOST_NO_RTTI
+ (*this) << original_exception_type(&typeid(e));
+#endif
+ }
+ };
+
+ namespace
+ exception_detail
+ {
+ template
+ class
+ current_exception_std_exception_wrapper:
+ public T,
+ public boost::exception,
+ public clone_base
+ {
+ public:
+
+ explicit
+ current_exception_std_exception_wrapper( T const & e1 ):
+ T(e1)
+ {
+ add_original_type(e1);
+ }
+
+ current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ):
+ T(e1),
+ boost::exception(e2)
+ {
+ add_original_type(e1);
+ }
+
+ ~current_exception_std_exception_wrapper() throw()
+ {
+ }
+
+ private:
+
+ clone_base const *
+ clone() const
+ {
+ return new current_exception_std_exception_wrapper(*this);
+ }
+
+ void
+ rethrow() const
+ {
+ throw *this;
+ }
+
+ template
+ void
+ add_original_type( E const & e )
+ {
+#ifndef BOOST_NO_RTTI
+ (*this) << original_exception_type(&typeid(e));
+#endif
+ }
+ };
+
+#ifdef BOOST_NO_RTTI
+ template
+ exception const *
+ get_boost_exception( T const * )
+ {
+ try
+ {
+ throw;
+ }
+ catch(
+ exception & x )
+ {
+ return &x;
+ }
+ catch(...)
+ {
+ return 0;
+ }
+ }
+#else
+ template
+ exception const *
+ get_boost_exception( T const * x )
+ {
+ return dynamic_cast(x);
+ }
+#endif
+
+ template
+ inline
+ shared_ptr
+ current_exception_std_exception( T const & e1 )
+ {
+ if( boost::exception const * e2 = get_boost_exception(&e1) )
+ return shared_ptr const>(new current_exception_std_exception_wrapper(e1,*e2));
+ else
+ return shared_ptr const>(new current_exception_std_exception_wrapper(e1));
+ }
+
+ inline
+ shared_ptr
+ current_exception_unknown_exception()
+ {
+ return shared_ptr(new unknown_exception());
+ }
+
+ inline
+ shared_ptr
+ current_exception_unknown_boost_exception( boost::exception const & e )
+ {
+ return shared_ptr(new unknown_exception(e));
+ }
+
+ inline
+ shared_ptr
+ current_exception_unknown_std_exception( std::exception const & e )
+ {
+ if( boost::exception const * be = get_boost_exception(&e) )
+ return current_exception_unknown_boost_exception(*be);
+ else
+ return shared_ptr(new unknown_exception(e));
+ }
+
+ inline
+ shared_ptr
+ current_exception_impl()
+ {
+ try
+ {
+ throw;
+ }
+ catch(
+ exception_detail::clone_base & e )
+ {
+ return shared_ptr(e.clone());
+ }
+ catch(
+ std::domain_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::invalid_argument & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::length_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::out_of_range & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::logic_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::range_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::overflow_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::underflow_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::ios_base::failure & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::runtime_error & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::bad_alloc & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+#ifndef BOOST_NO_TYPEID
+ catch(
+ std::bad_cast & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::bad_typeid & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+#endif
+ catch(
+ std::bad_exception & e )
+ {
+ return exception_detail::current_exception_std_exception(e);
+ }
+ catch(
+ std::exception & e )
+ {
+ return exception_detail::current_exception_unknown_std_exception(e);
+ }
+ catch(
+ boost::exception & e )
+ {
+ return exception_detail::current_exception_unknown_boost_exception(e);
+ }
+ catch(
+ ... )
+ {
+ return exception_detail::current_exception_unknown_exception();
+ }
+ }
+ }
+
+ inline
+ exception_ptr
+ current_exception()
+ {
+ try
+ {
+ return exception_ptr(exception_detail::current_exception_impl());
+ }
+ catch(
+ std::bad_alloc & )
+ {
+ }
+ catch(
+ ... )
+ {
+ try
+ {
+ return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception()));
+ }
+ catch(
+ std::bad_alloc & )
+ {
+ }
+ catch(
+ ... )
+ {
+ BOOST_ASSERT(0);
+ }
+ }
+ return exception_ptr(exception_ptr::bad_alloc_tag());
+ }
+
+ template
+ inline
+ exception_ptr
+ copy_exception( T const & e )
+ {
+ try
+ {
+ throw enable_current_exception(e);
+ }
+ catch(
+ ... )
+ {
+ return current_exception();
+ }
+ }
+
+ inline
+ void
+ rethrow_exception( exception_ptr const & p )
+ {
+ p.rethrow();
+ }
+
+ inline
+ std::string
+ diagnostic_information( exception_ptr const & p )
+ {
+ if( p )
+ try
+ {
+ rethrow_exception(p);
+ }
+ catch(
+ ... )
+ {
+ return current_exception_diagnostic_information();
+ }
+ return "";
+ }
+
+ inline
+ std::string
+ to_string( exception_ptr const & p )
+ {
+ std::string s='\n'+diagnostic_information(p);
+ std::string padding(" ");
+ std::string r;
+ bool f=false;
+ for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i )
+ {
+ if( f )
+ r+=padding;
+ char c=*i;
+ r+=c;
+ f=(c=='\n');
+ }
+ return r;
+ }
+ }
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/include/boost/exception/detail/exception_ptr_base.hpp b/include/boost/exception/detail/exception_ptr_base.hpp
deleted file mode 100644
index ac68cab..0000000
--- a/include/boost/exception/detail/exception_ptr_base.hpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
-
-//Distributed under the Boost Software License, Version 1.0. (See accompanying
-//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef UUID_DC4208C6417811DEBF11E1EC55D89593
-#define UUID_DC4208C6417811DEBF11E1EC55D89593
-
-namespace
-boost
- {
- namespace
- exception_detail
- {
- class
- exception_ptr_base
- {
- public:
-
- virtual void _rethrow() const=0;
- virtual bool _empty() const=0;
-
- protected:
-
- virtual
- ~exception_ptr_base() throw()
- {
- }
- };
- }
- }
-
-#endif
diff --git a/include/boost/exception/detail/is_output_streamable.hpp b/include/boost/exception/detail/is_output_streamable.hpp
index af59cb8..5eb1695 100644
--- a/include/boost/exception/detail/is_output_streamable.hpp
+++ b/include/boost/exception/detail/is_output_streamable.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_898984B4076411DD973EDFA055D89593
#define UUID_898984B4076411DD973EDFA055D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
@@ -35,4 +41,7 @@ boost
};
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/detail/object_hex_dump.hpp b/include/boost/exception/detail/object_hex_dump.hpp
index 75a4179..ccf1bac 100644
--- a/include/boost/exception/detail/object_hex_dump.hpp
+++ b/include/boost/exception/detail/object_hex_dump.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
#define UUID_6F463AC838DF11DDA3E6909F56D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
#include
@@ -38,4 +44,7 @@ boost
}
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/detail/type_info.hpp b/include/boost/exception/detail/type_info.hpp
index 6819c80..60709a1 100644
--- a/include/boost/exception/detail/type_info.hpp
+++ b/include/boost/exception/detail/type_info.hpp
@@ -5,9 +5,16 @@
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
#define UUID_C3E1741C754311DDB2834CCA55D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
#include
+#include
namespace
boost
@@ -39,92 +46,34 @@ boost
namespace
exception_detail
{
-#ifdef BOOST_NO_TYPEID
struct
type_info_
{
- detail::sp_typeinfo const * type_;
- char const * name_;
-
- explicit
- type_info_( detail::sp_typeinfo const & type, char const * name ):
- type_(&type),
- name_(name)
- {
- }
-
- friend
- bool
- operator==( type_info_ const & a, type_info_ const & b )
- {
- return (*a.type_)==(*b.type_);
- }
-
- friend
- bool
- operator<( type_info_ const & a, type_info_ const & b )
- {
- return 0!=(a.type_->before(*b.type_));
- }
-
- char const *
- name() const
- {
- return name_;
- }
- };
-#else
- struct
- type_info_
- {
- detail::sp_typeinfo const * type_;
+ detail::sp_typeinfo const & type_;
explicit
type_info_( detail::sp_typeinfo const & type ):
- type_(&type)
+ type_(type)
{
}
- type_info_( detail::sp_typeinfo const & type, char const * ):
- type_(&type)
- {
- }
-
- friend
- bool
- operator==( type_info_ const & a, type_info_ const & b )
- {
- return (*a.type_)==(*b.type_);
- }
-
friend
bool
operator<( type_info_ const & a, type_info_ const & b )
{
- return 0!=(a.type_->before(*b.type_));
- }
-
- char const *
- name() const
- {
- return type_->name();
+ return 0!=(a.type_.before(b.type_));
}
};
-#endif
-
- inline
- bool
- operator!=( type_info_ const & a, type_info_ const & b )
- {
- return !(a==b);
- }
}
}
-#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::tag_type_name())
+#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
#ifndef BOOST_NO_RTTI
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/diagnostic_information.hpp b/include/boost/exception/diagnostic_information.hpp
index 1ea9dc1..632a5a3 100644
--- a/include/boost/exception/diagnostic_information.hpp
+++ b/include/boost/exception/diagnostic_information.hpp
@@ -5,42 +5,79 @@
#ifndef UUID_0552D49838DD11DD90146B8956D89593
#define UUID_0552D49838DD11DD90146B8956D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
#include
-#include
#include
+#include
#include
#include
#include
+#ifndef BOOST_NO_EXCEPTIONS
+#include
+namespace
+boost
+ {
+ namespace
+ exception_detail
+ {
+ std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool );
+ }
+
+ inline
+ std::string
+ current_exception_diagnostic_information()
+ {
+ boost::exception const * be=current_exception_cast();
+ std::exception const * se=current_exception_cast();
+ if( be || se )
+ return exception_detail::diagnostic_information_impl(be,se,true);
+ else
+ return "No diagnostic information available.";
+ }
+ }
+#endif
+
namespace
boost
{
namespace
exception_detail
{
- template
- struct
- enable_boost_exception_overload
+ inline
+ exception const *
+ get_boost_exception( exception const * e )
{
- struct yes { char q[100]; };
- typedef char no;
- static yes check(exception const *);
- static no check(...);
- enum e { value=sizeof(check((T*)0))==sizeof(yes) };
- };
+ return e;
+ }
- template
- struct
- enable_std_exception_overload
+ inline
+ exception const *
+ get_boost_exception( ... )
{
- struct yes { char q[100]; };
- typedef char no;
- static yes check(std::exception const *);
- static no check(...);
- enum e { value = !enable_boost_exception_overload::value && sizeof(check((T*)0))==sizeof(yes) };
- };
+ return 0;
+ }
+
+ inline
+ std::exception const *
+ get_std_exception( std::exception const * e )
+ {
+ return e;
+ }
+
+ inline
+ std::exception const *
+ get_std_exception( ... )
+ {
+ return 0;
+ }
inline
char const *
@@ -65,12 +102,13 @@ boost
std::string
diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what )
{
- BOOST_ASSERT(be||se);
+ if( !be && !se )
+ return "Unknown exception.";
#ifndef BOOST_NO_RTTI
- if( !se )
- se = dynamic_cast(be);
if( !be )
- be = dynamic_cast(se);
+ be=dynamic_cast(se);
+ if( !se )
+ se=dynamic_cast(be);
#endif
char const * wh=0;
if( with_what && se )
@@ -97,7 +135,7 @@ boost
}
#ifndef BOOST_NO_RTTI
tmp << std::string("Dynamic exception type: ") <<
- (be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).name() << '\n';
+ (be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).type_.name() << '\n';
#endif
if( with_what && se )
tmp << "std::exception::what: " << wh << '\n';
@@ -110,19 +148,10 @@ boost
}
template
- inline
- typename enable_if,std::string>::type
+ std::string
diagnostic_information( T const & e )
{
- return exception_detail::diagnostic_information_impl(&e,0,true);
- }
-
- template
- inline
- typename enable_if,std::string>::type
- diagnostic_information( T const & e )
- {
- return exception_detail::diagnostic_information_impl(0,&e,true);
+ return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true);
}
inline
@@ -147,40 +176,7 @@ boost
}
}
-#ifndef BOOST_NO_EXCEPTIONS
-#include
-namespace
-boost
- {
- inline
- std::string
- current_exception_diagnostic_information()
- {
- boost::exception const * be=current_exception_cast();
- std::exception const * se=current_exception_cast();
- if( be || se )
- return exception_detail::diagnostic_information_impl(be,se,true);
- else
- return "No diagnostic information available.";
- }
-
- inline
- std::string
- diagnostic_information( exception_detail::exception_ptr_base const & p )
- {
- if( !p._empty() )
- try
- {
- p._rethrow();
- }
- catch(
- ... )
- {
- return current_exception_diagnostic_information();
- }
- return "";
- }
- }
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
#endif
-
#endif
diff --git a/include/boost/exception/errinfo_errno.hpp b/include/boost/exception/errinfo_errno.hpp
index 310ceb7..ea74010 100644
--- a/include/boost/exception/errinfo_errno.hpp
+++ b/include/boost/exception/errinfo_errno.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_F0EE17BE6C1211DE87FF459155D89593
#define UUID_F0EE17BE6C1211DE87FF459155D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include "boost/exception/info.hpp"
#include
@@ -32,4 +38,7 @@ boost
}
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp
index fbc0594..79b2739 100644
--- a/include/boost/exception/exception.hpp
+++ b/include/boost/exception/exception.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
#define UUID_274DA366004E11DCB1DDFE2E56D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
namespace
boost
@@ -129,6 +135,15 @@ boost
template
E const & operator<<( E const &, error_info const & );
+ template
+ E const & operator<<( E const &, throw_function const & );
+
+ template
+ E const & operator<<( E const &, throw_file const & );
+
+ template
+ E const & operator<<( E const &, throw_line const & );
+
class exception;
template
@@ -151,7 +166,6 @@ boost
protected:
- virtual
~error_info_container() throw()
{
}
@@ -202,34 +216,19 @@ boost
#endif
;
+#if defined(__MWERKS__) && __MWERKS__<=0x3207
+ public:
+#else
private:
template
- friend
- E const &
- operator<<( E const & x, throw_function const & y )
- {
- x.throw_function_=y.v_;
- return x;
- }
+ friend E const & operator<<( E const &, throw_function const & );
template
- friend
- E const &
- operator<<( E const & x, throw_file const & y )
- {
- x.throw_file_=y.v_;
- return x;
- }
+ friend E const & operator<<( E const &, throw_file const & );
template
- friend
- E const &
- operator<<( E const & x, throw_line const & y )
- {
- x.throw_line_=y.v_;
- return x;
- }
+ friend E const & operator<<( E const &, throw_line const & );
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
@@ -241,7 +240,7 @@ boost
friend struct exception_detail::get_info;
friend struct exception_detail::get_info;
friend struct exception_detail::get_info;
-
+#endif
mutable exception_detail::refcount_ptr data_;
mutable char const * throw_function_;
mutable char const * throw_file_;
@@ -254,6 +253,30 @@ boost
{
}
+ template
+ E const &
+ operator<<( E const & x, throw_function const & y )
+ {
+ x.throw_function_=y.v_;
+ return x;
+ }
+
+ template
+ E const &
+ operator<<( E const & x, throw_file const & y )
+ {
+ x.throw_file_=y.v_;
+ return x;
+ }
+
+ template
+ E const &
+ operator<<( E const & x, throw_line const & y )
+ {
+ x.throw_line_=y.v_;
+ return x;
+ }
+
////////////////////////////////////////////////////////////////////////
namespace
@@ -393,4 +416,7 @@ boost
}
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/get_error_info.hpp b/include/boost/exception/get_error_info.hpp
index 640a612..046f05a 100644
--- a/include/boost/exception/get_error_info.hpp
+++ b/include/boost/exception/get_error_info.hpp
@@ -5,6 +5,12 @@
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
#define UUID_1A590226753311DD9E4CCF6156D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
#include
@@ -118,4 +124,7 @@ boost
#endif
}
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
#endif
diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp
index c1b76c0..cbbc2c0 100644
--- a/include/boost/exception/info.hpp
+++ b/include/boost/exception/info.hpp
@@ -5,11 +5,18 @@
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
#define UUID_8D22C4CA9CC811DCAA9133D256D89593
+#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
#include
#include
#include
#include
+#include
#include