diff options
Diffstat (limited to 'boost/exception')
-rw-r--r-- | boost/exception/N3757.hpp | 46 | ||||
-rw-r--r-- | boost/exception/all.hpp | 11 | ||||
-rw-r--r-- | boost/exception/detail/error_info_impl.hpp | 59 | ||||
-rw-r--r-- | boost/exception/detail/exception_ptr.hpp | 19 | ||||
-rw-r--r-- | boost/exception/detail/is_output_streamable.hpp | 5 | ||||
-rw-r--r-- | boost/exception/detail/object_hex_dump.hpp | 13 | ||||
-rw-r--r-- | boost/exception/detail/type_info.hpp | 13 | ||||
-rw-r--r-- | boost/exception/diagnostic_information.hpp | 17 | ||||
-rw-r--r-- | boost/exception/enable_current_exception.hpp | 5 | ||||
-rw-r--r-- | boost/exception/enable_error_info.hpp | 5 | ||||
-rw-r--r-- | boost/exception/errinfo_errno.hpp | 9 | ||||
-rw-r--r-- | boost/exception/get_error_info.hpp | 14 | ||||
-rw-r--r-- | boost/exception/info.hpp | 60 | ||||
-rw-r--r-- | boost/exception/info_tuple.hpp | 7 | ||||
-rw-r--r-- | boost/exception/to_string.hpp | 9 | ||||
-rw-r--r-- | boost/exception/to_string_stub.hpp | 9 |
16 files changed, 126 insertions, 175 deletions
diff --git a/boost/exception/N3757.hpp b/boost/exception/N3757.hpp deleted file mode 100644 index 23b06066b1..0000000000 --- a/boost/exception/N3757.hpp +++ /dev/null @@ -1,46 +0,0 @@ -//Copyright (c) 2006-2013 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_9011016A11A711E3B46CD9FA6088709B -#define UUID_9011016A11A711E3B46CD9FA6088709B -#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/exception/info.hpp> -#include <boost/exception/get_error_info.hpp> - -namespace -boost - { - //Here we're using the boost::error_info machinery to store the info in the exception - //object. Within the context of N3757, this is strictly an implementation detail. - - template <class Tag> - inline - void - exception:: - set( typename Tag::type const & v ) - { - exception_detail::set_info(*this,error_info<Tag,typename Tag::type>(v)); - } - - template <class Tag> - inline - typename Tag::type const * - exception:: - get() const - { - return get_error_info<error_info<Tag,typename Tag::type> >(*this); - } - } - -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) -#pragma warning(pop) -#endif -#endif diff --git a/boost/exception/all.hpp b/boost/exception/all.hpp index 32eb15051f..58b02d00c1 100644 --- a/boost/exception/all.hpp +++ b/boost/exception/all.hpp @@ -5,13 +5,8 @@ #ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593 #define UUID_316FDA946C0D11DEA9CBAE5255D89593 -#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> #include <boost/exception/diagnostic_information.hpp> #include <boost/exception/error_info.hpp> #include <boost/exception/exception.hpp> @@ -29,8 +24,4 @@ #include <boost/exception/errinfo_nested_exception.hpp> #include <boost/exception_ptr.hpp> #endif - -#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) -#pragma warning(pop) -#endif #endif diff --git a/boost/exception/detail/error_info_impl.hpp b/boost/exception/detail/error_info_impl.hpp index ecd086dd87..6c48d61ab3 100644 --- a/boost/exception/detail/error_info_impl.hpp +++ b/boost/exception/detail/error_info_impl.hpp @@ -5,6 +5,14 @@ #ifndef UUID_CE6983AC753411DDA764247956D89593 #define UUID_CE6983AC753411DDA764247956D89593 + +#include <boost/config.hpp> +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +#include <boost/type_traits/is_nothrow_move_constructible.hpp> +#endif +#include <utility> +#include <string> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -12,10 +20,6 @@ #pragma warning(push,1) #endif -#include <boost/config.hpp> -#include <utility> -#include <string> - namespace boost { @@ -28,8 +32,7 @@ boost public: virtual std::string name_value_string() const = 0; - - protected: + virtual error_info_base * clone() const = 0; virtual ~error_info_base() throw() @@ -43,39 +46,53 @@ boost error_info: public exception_detail::error_info_base { + error_info_base * + clone() const + { + return new error_info<Tag,T>(*this); + } public: - typedef T value_type; - - error_info( value_type const & value ); + error_info( value_type const & v ): + v_(v) + { + } +#if (__GNUC__*100+__GNUC_MINOR__!=406) //workaround for g++ bug #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - error_info( error_info const & ); - error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value)))); - error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_)))); + error_info( error_info const & x ): + v_(x.v_) + { + } + error_info( T && v ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value): + v_(std::move(v)) + { + } + error_info( error_info && x ) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible<T>::value): + v_(std::move(x.v_)) + { + } #endif - ~error_info() throw(); - +#endif + ~error_info() throw() + { + } value_type const & value() const { - return value_; + return v_; } - value_type & value() { - return value_; + return v_; } - private: error_info & operator=( error_info const & ); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES error_info & operator=( error_info && x ); #endif - std::string name_value_string() const; - - value_type value_; + value_type v_; }; } diff --git a/boost/exception/detail/exception_ptr.hpp b/boost/exception/detail/exception_ptr.hpp index cac64e6ab3..8e19f0d9df 100644 --- a/boost/exception/detail/exception_ptr.hpp +++ b/boost/exception/detail/exception_ptr.hpp @@ -5,12 +5,6 @@ #ifndef UUID_618474C2DE1511DEB74A388C56D89593 #define UUID_618474C2DE1511DEB74A388C56D89593 -#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_NO_EXCEPTIONS @@ -19,8 +13,8 @@ #include <boost/exception/exception.hpp> #include <boost/exception/info.hpp> #include <boost/exception/diagnostic_information.hpp> -#include <boost/exception/detail/type_info.hpp> #include <boost/exception/detail/clone_current_exception.hpp> +#include <boost/exception/detail/type_info.hpp> #ifndef BOOST_NO_RTTI #include <boost/core/demangle.hpp> #endif @@ -30,6 +24,13 @@ #include <ios> #include <stdlib.h> +#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 + namespace boost { @@ -394,7 +395,7 @@ boost { return exception_detail::current_exception_std_exception(e); } -#ifndef BOOST_NO_TYPEID + #ifndef BOOST_NO_TYPEID catch( std::bad_cast & e ) { @@ -405,7 +406,7 @@ boost { return exception_detail::current_exception_std_exception(e); } -#endif + #endif catch( std::bad_exception & e ) { diff --git a/boost/exception/detail/is_output_streamable.hpp b/boost/exception/detail/is_output_streamable.hpp index 847f3484b8..10e5c5163e 100644 --- a/boost/exception/detail/is_output_streamable.hpp +++ b/boost/exception/detail/is_output_streamable.hpp @@ -5,6 +5,9 @@ #ifndef UUID_898984B4076411DD973EDFA055D89593 #define UUID_898984B4076411DD973EDFA055D89593 + +#include <ostream> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -12,8 +15,6 @@ #pragma warning(push,1) #endif -#include <ostream> - namespace boost { diff --git a/boost/exception/detail/object_hex_dump.hpp b/boost/exception/detail/object_hex_dump.hpp index 53c8bf6f36..267bf0bf3e 100644 --- a/boost/exception/detail/object_hex_dump.hpp +++ b/boost/exception/detail/object_hex_dump.hpp @@ -5,12 +5,6 @@ #ifndef UUID_6F463AC838DF11DDA3E6909F56D89593 #define UUID_6F463AC838DF11DDA3E6909F56D89593 -#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/exception/detail/type_info.hpp> #include <iomanip> @@ -19,6 +13,13 @@ #include <sstream> #include <cstdlib> +#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 + namespace boost { diff --git a/boost/exception/detail/type_info.hpp b/boost/exception/detail/type_info.hpp index b8c7d48bae..739ac5748e 100644 --- a/boost/exception/detail/type_info.hpp +++ b/boost/exception/detail/type_info.hpp @@ -5,6 +5,13 @@ #ifndef UUID_C3E1741C754311DDB2834CCA55D89593 #define UUID_C3E1741C754311DDB2834CCA55D89593 + +#include <boost/config.hpp> +#include <boost/core/typeinfo.hpp> +#include <boost/core/demangle.hpp> +#include <boost/current_function.hpp> +#include <string> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -12,12 +19,6 @@ #pragma warning(push,1) #endif -#include <boost/core/typeinfo.hpp> -#include <boost/core/demangle.hpp> -#include <boost/current_function.hpp> -#include <boost/config.hpp> -#include <string> - namespace boost { diff --git a/boost/exception/diagnostic_information.hpp b/boost/exception/diagnostic_information.hpp index 305e8edd61..48f06a0fb9 100644 --- a/boost/exception/diagnostic_information.hpp +++ b/boost/exception/diagnostic_information.hpp @@ -5,12 +5,6 @@ #ifndef UUID_0552D49838DD11DD90146B8956D89593 #define UUID_0552D49838DD11DD90146B8956D89593 -#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> #include <boost/exception/get_error_info.hpp> @@ -22,9 +16,18 @@ #include <exception> #include <sstream> #include <string> - #ifndef BOOST_NO_EXCEPTIONS #include <boost/exception/current_exception_cast.hpp> +#endif + +#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 + +#ifndef BOOST_NO_EXCEPTIONS namespace boost { diff --git a/boost/exception/enable_current_exception.hpp b/boost/exception/enable_current_exception.hpp index 988105378c..495cc90a59 100644 --- a/boost/exception/enable_current_exception.hpp +++ b/boost/exception/enable_current_exception.hpp @@ -3,4 +3,9 @@ //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_851700A4F7CF11E6B2EE06DD14915323 +#define UUID_851700A4F7CF11E6B2EE06DD14915323 + #include <boost/exception/exception.hpp> + +#endif diff --git a/boost/exception/enable_error_info.hpp b/boost/exception/enable_error_info.hpp index 988105378c..202217af66 100644 --- a/boost/exception/enable_error_info.hpp +++ b/boost/exception/enable_error_info.hpp @@ -3,4 +3,9 @@ //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_A0F7404AF7CF11E6908227DD14915323 +#define UUID_A0F7404AF7CF11E6908227DD14915323 + #include <boost/exception/exception.hpp> + +#endif diff --git a/boost/exception/errinfo_errno.hpp b/boost/exception/errinfo_errno.hpp index de44e17155..ebd8f25fbc 100644 --- a/boost/exception/errinfo_errno.hpp +++ b/boost/exception/errinfo_errno.hpp @@ -5,6 +5,11 @@ #ifndef UUID_F0EE17BE6C1211DE87FF459155D89593 #define UUID_F0EE17BE6C1211DE87FF459155D89593 + +#include <boost/exception/info.hpp> +#include <errno.h> +#include <string.h> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -13,10 +18,6 @@ #pragma warning(disable:4996) #endif -#include <boost/exception/info.hpp> -#include <errno.h> -#include <string.h> - namespace boost { diff --git a/boost/exception/get_error_info.hpp b/boost/exception/get_error_info.hpp index 51a21ba899..831717df59 100644 --- a/boost/exception/get_error_info.hpp +++ b/boost/exception/get_error_info.hpp @@ -5,19 +5,21 @@ #ifndef UUID_1A590226753311DD9E4CCF6156D89593 #define UUID_1A590226753311DD9E4CCF6156D89593 -#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> #include <boost/exception/exception.hpp> #include <boost/exception/detail/error_info_impl.hpp> #include <boost/exception/detail/type_info.hpp> #include <boost/exception/detail/shared_ptr.hpp> #include <boost/assert.hpp> +#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 + namespace boost { diff --git a/boost/exception/info.hpp b/boost/exception/info.hpp index f06df42aaf..f7ac50ecfc 100644 --- a/boost/exception/info.hpp +++ b/boost/exception/info.hpp @@ -5,20 +5,21 @@ #ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593 #define UUID_8D22C4CA9CC811DCAA9133D256D89593 -#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> #include <boost/exception/exception.hpp> #include <boost/exception/to_string_stub.hpp> #include <boost/exception/detail/error_info_impl.hpp> #include <boost/exception/detail/shared_ptr.hpp> -#include <boost/config.hpp> #include <map> +#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 + namespace boost { @@ -40,45 +41,6 @@ boost template <class Tag,class T> inline - error_info<Tag,T>:: - error_info( value_type const & value ): - value_(value) - { - } - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template <class Tag,class T> - inline - error_info<Tag,T>:: - error_info( error_info const & x ): - value_(x.value_) - { - } - template <class Tag,class T> - inline - error_info<Tag,T>:: - error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value)))): - value_(std::move(value)) - { - } - template <class Tag,class T> - inline - error_info<Tag,T>:: - error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_)))): - value_(std::move(x.value_)) - { - } -#endif - - template <class Tag,class T> - inline - error_info<Tag,T>:: - ~error_info() throw() - { - } - - template <class Tag,class T> - inline std::string error_info<Tag,T>:: name_value_string() const @@ -180,7 +142,11 @@ boost refcount_ptr<error_info_container> p; error_info_container_impl * c=new error_info_container_impl; p.adopt(c); - c->info_ = info_; + for( error_info_map::const_iterator i=info_.begin(),e=info_.end(); i!=e; ++i ) + { + shared_ptr<error_info_base> cp(i->second->clone()); + c->info_.insert(std::make_pair(i->first,cp)); + } return p; } }; diff --git a/boost/exception/info_tuple.hpp b/boost/exception/info_tuple.hpp index 70154fd278..7c16d75151 100644 --- a/boost/exception/info_tuple.hpp +++ b/boost/exception/info_tuple.hpp @@ -5,6 +5,10 @@ #ifndef UUID_63EE924290FB11DC87BB856555D89593 #define UUID_63EE924290FB11DC87BB856555D89593 + +#include <boost/exception/info.hpp> +#include <boost/tuple/tuple.hpp> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -12,9 +16,6 @@ #pragma warning(push,1) #endif -#include <boost/exception/info.hpp> -#include <boost/tuple/tuple.hpp> - namespace boost { diff --git a/boost/exception/to_string.hpp b/boost/exception/to_string.hpp index 68541d2b8c..51425b10d1 100644 --- a/boost/exception/to_string.hpp +++ b/boost/exception/to_string.hpp @@ -5,6 +5,11 @@ #ifndef UUID_7E48761AD92811DC9011477D56D89593 #define UUID_7E48761AD92811DC9011477D56D89593 + +#include <boost/utility/enable_if.hpp> +#include <boost/exception/detail/is_output_streamable.hpp> +#include <sstream> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -12,10 +17,6 @@ #pragma warning(push,1) #endif -#include <boost/utility/enable_if.hpp> -#include <boost/exception/detail/is_output_streamable.hpp> -#include <sstream> - namespace boost { diff --git a/boost/exception/to_string_stub.hpp b/boost/exception/to_string_stub.hpp index b6ab31cf86..8ff5e47fd6 100644 --- a/boost/exception/to_string_stub.hpp +++ b/boost/exception/to_string_stub.hpp @@ -5,6 +5,11 @@ #ifndef UUID_E788439ED9F011DCB181F25B55D89593 #define UUID_E788439ED9F011DCB181F25B55D89593 + +#include <boost/exception/to_string.hpp> +#include <boost/exception/detail/object_hex_dump.hpp> +#include <boost/assert.hpp> + #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif @@ -12,10 +17,6 @@ #pragma warning(push,1) #endif -#include <boost/exception/to_string.hpp> -#include <boost/exception/detail/object_hex_dump.hpp> -#include <boost/assert.hpp> - namespace boost { |