diff options
Diffstat (limited to 'boost/exception/exception.hpp')
-rw-r--r-- | boost/exception/exception.hpp | 120 |
1 files changed, 62 insertions, 58 deletions
diff --git a/boost/exception/exception.hpp b/boost/exception/exception.hpp index c0fdaf9e55..d5c22c4ca2 100644 --- a/boost/exception/exception.hpp +++ b/boost/exception/exception.hpp @@ -5,21 +5,24 @@ #ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 #define UUID_274DA366004E11DCB1DDFE2E56D89593 -#if (__GNUC__*100+__GNUC_MINOR__>301) && !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/config.hpp> #ifdef BOOST_EXCEPTION_MINI_BOOST #include <memory> namespace boost { namespace exception_detail { using std::shared_ptr; } } #else -namespace boost { template <class T> class shared_ptr; }; +namespace boost { template <class T> class shared_ptr; } namespace boost { namespace exception_detail { using boost::shared_ptr; } } #endif +#if defined(__GNUC__) && (__GNUC__*100+__GNUC_MINOR__>301) && !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 { @@ -140,17 +143,9 @@ boost } }; -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif -#endif - class exception; -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif -#endif + class + BOOST_SYMBOL_VISIBLE + exception; namespace exception_detail @@ -216,12 +211,8 @@ boost E const & set_info( E const &, throw_line const & ); } -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif -#endif class + BOOST_SYMBOL_VISIBLE exception { //<N3757> @@ -293,11 +284,6 @@ boost mutable char const * throw_file_; mutable int throw_line_; }; -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif -#endif inline exception:: @@ -338,13 +324,9 @@ boost namespace exception_detail { -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif -#endif template <class T> struct + BOOST_SYMBOL_VISIBLE error_info_injector: public T, public exception @@ -359,11 +341,6 @@ boost { } }; -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif -#endif struct large_size { char c[256]; }; large_size dispatch_boost_exception( exception const * ); @@ -411,12 +388,8 @@ boost namespace exception_detail { -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif -#endif class + BOOST_SYMBOL_VISIBLE clone_base { public: @@ -429,11 +402,6 @@ boost { } }; -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif -#endif inline void @@ -454,13 +422,9 @@ boost { } -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility push (default) -# endif -#endif template <class T> class + BOOST_SYMBOL_VISIBLE clone_impl: public T, public virtual clone_base @@ -500,11 +464,6 @@ boost } }; } -#if defined(__GNUC__) -# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) -# pragma GCC visibility pop -# endif -#endif template <class T> inline @@ -513,6 +472,51 @@ boost { return exception_detail::clone_impl<T>(x); } + + template <class T> + struct + BOOST_SYMBOL_VISIBLE + wrapexcept: + public exception_detail::clone_impl<typename exception_detail::enable_error_info_return_type<T>::type> + { + typedef exception_detail::clone_impl<typename exception_detail::enable_error_info_return_type<T>::type> base_type; + public: + explicit + wrapexcept( typename exception_detail::enable_error_info_return_type<T>::type const & x ): + base_type( x ) + { + } + + ~wrapexcept() throw() + { + } + }; + + namespace + exception_detail + { + template <class T> + struct + remove_error_info_injector + { + typedef T type; + }; + + template <class T> + struct + remove_error_info_injector< error_info_injector<T> > + { + typedef T type; + }; + + template <class T> + inline + wrapexcept<typename remove_error_info_injector<T>::type> + enable_both( T const & x ) + { + return wrapexcept<typename remove_error_info_injector<T>::type>( enable_error_info( x ) ); + } + } } #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) |