diff --git a/include/boost/exception/detail/error_info_impl.hpp b/include/boost/exception/detail/error_info_impl.hpp index dbe0afd..ecd086d 100644 --- a/include/boost/exception/detail/error_info_impl.hpp +++ b/include/boost/exception/detail/error_info_impl.hpp @@ -43,7 +43,7 @@ boost error_info: public exception_detail::error_info_base { - public: + public: typedef T value_type; @@ -67,7 +67,7 @@ boost return value_; } - private: + private: error_info & operator=( error_info const & ); #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES error_info & operator=( error_info && x ); diff --git a/include/boost/exception/detail/shared_ptr.hpp b/include/boost/exception/detail/shared_ptr.hpp new file mode 100644 index 0000000..51febe8 --- /dev/null +++ b/include/boost/exception/detail/shared_ptr.hpp @@ -0,0 +1,17 @@ +//Copyright (c) 2006-2008 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_837060E885AF11E68DA91D15E31AC075 +#define UUID_837060E885AF11E68DA91D15E31AC075 + +#ifdef BOOST_EXCEPTION_MINI_BOOST +#include +namespace boost { namespace exception_detail { using std::shared_ptr; } } +#else +#include +namespace boost { namespace exception_detail { using boost::shared_ptr; } } +#endif + +#endif diff --git a/include/boost/exception/errinfo_api_function.hpp b/include/boost/exception/errinfo_api_function.hpp index 481c613..0cbbdb9 100644 --- a/include/boost/exception/errinfo_api_function.hpp +++ b/include/boost/exception/errinfo_api_function.hpp @@ -6,7 +6,7 @@ #ifndef UUID_DDFBB4546C1211DEA4659E9055D89593 #define UUID_DDFBB4546C1211DEA4659E9055D89593 -#include "boost/exception/error_info.hpp" +#include namespace boost diff --git a/include/boost/exception/errinfo_errno.hpp b/include/boost/exception/errinfo_errno.hpp index 657b5f7..de44e17 100644 --- a/include/boost/exception/errinfo_errno.hpp +++ b/include/boost/exception/errinfo_errno.hpp @@ -13,7 +13,7 @@ #pragma warning(disable:4996) #endif -#include "boost/exception/info.hpp" +#include #include #include diff --git a/include/boost/exception/get_error_info.hpp b/include/boost/exception/get_error_info.hpp index 96be763..51a21ba 100644 --- a/include/boost/exception/get_error_info.hpp +++ b/include/boost/exception/get_error_info.hpp @@ -15,7 +15,8 @@ #include #include #include -#include +#include +#include namespace boost diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index f955e09..f06df42 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include @@ -47,27 +47,27 @@ boost } #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template - inline - error_info:: - error_info( error_info const & x ): - value_(x.value_) - { - } template inline error_info:: - error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value)))): - value_(std::move(value)) - { - } - template + error_info( error_info const & x ): + value_(x.value_) + { + } + template inline error_info:: - error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_)))): - value_(std::move(x.value_)) - { - } + error_info( value_type && value ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(value)))): + value_(std::move(value)) + { + } + template + inline + error_info:: + error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.value_)))): + value_(std::move(x.value_)) + { + } #endif template @@ -202,79 +202,79 @@ boost #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template E const & set_info( E const &, error_info && ); - template - class set_info_rv; - template - class - set_info_rv > - { - template - friend E const & set_info( E const &, error_info && ); - template - static - E const & - set( E const & x, error_info && v ) - { - typedef error_info error_info_tag_t; - shared_ptr p( new error_info_tag_t(std::move(v)) ); - exception_detail::error_info_container * c=x.data_.get(); - if( !c ) - x.data_.adopt(c=new exception_detail::error_info_container_impl); - c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); - return x; - } - }; - template <> - class - set_info_rv - { - template - friend E const & set_info( E const &, error_info && ); - template - static - E const & - set( E const & x, throw_function && y ) - { - x.throw_function_=y.v_; - return x; - } - }; - template <> - class - set_info_rv - { - template - friend E const & set_info( E const &, error_info && ); - template - static - E const & - set( E const & x, throw_file && y ) - { - x.throw_file_=y.v_; - return x; - } - }; - template <> - class - set_info_rv - { - template - friend E const & set_info( E const &, error_info && ); - template - static - E const & - set( E const & x, throw_line && y ) - { - x.throw_line_=y.v_; - return x; - } - }; + template + struct set_info_rv; + template + struct + set_info_rv > + { + template + friend E const & set_info( E const &, error_info && ); + template + static + E const & + set( E const & x, error_info && v ) + { + typedef error_info error_info_tag_t; + shared_ptr p( new error_info_tag_t(std::move(v)) ); + exception_detail::error_info_container * c=x.data_.get(); + if( !c ) + x.data_.adopt(c=new exception_detail::error_info_container_impl); + c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); + return x; + } + }; + template <> + struct + set_info_rv + { + template + friend E const & set_info( E const &, error_info && ); + template + static + E const & + set( E const & x, throw_function && y ) + { + x.throw_function_=y.v_; + return x; + } + }; + template <> + struct + set_info_rv + { + template + friend E const & set_info( E const &, error_info && ); + template + static + E const & + set( E const & x, throw_file && y ) + { + x.throw_file_=y.v_; + return x; + } + }; + template <> + struct + set_info_rv + { + template + friend E const & set_info( E const &, error_info && ); + template + static + E const & + set( E const & x, throw_line && y ) + { + x.throw_line_=y.v_; + return x; + } + }; template inline E const & set_info( E const & x, error_info && v ) { - return set_info_rv >::template set(x,std::move(v)); + return set_info_rv >::template set(x,std::move(v)); } #endif diff --git a/test/N3757_test.cpp b/test/N3757_test.cpp index caa93ba..9dfcdc6 100644 --- a/test/N3757_test.cpp +++ b/test/N3757_test.cpp @@ -37,7 +37,7 @@ main() throw my_exception(); } catch( - boost::exception & e ) + boost::exception & e ) { e.set(42); e.set("42"); diff --git a/test/error_info_lv_const_test.cpp b/test/error_info_lv_const_test.cpp index c79f97a..68e57a9 100644 --- a/test/error_info_lv_const_test.cpp +++ b/test/error_info_lv_const_test.cpp @@ -3,11 +3,11 @@ //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) -#include "boost/exception/info.hpp" +#include template E const & add_info( E const & e, I const & i ) - { - return e << i; - } + { + return e << i; + } #include "error_info_test.hpp" diff --git a/test/error_info_lv_test.cpp b/test/error_info_lv_test.cpp index 994b941..66334b4 100644 --- a/test/error_info_lv_test.cpp +++ b/test/error_info_lv_test.cpp @@ -3,11 +3,11 @@ //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) -#include "boost/exception/info.hpp" +#include template E const & add_info( E const & e, I i ) - { - return e << i; - } + { + return e << i; + } #include "error_info_test.hpp" diff --git a/test/error_info_rv_const_test.cpp b/test/error_info_rv_const_test.cpp index 2906061..23b137f 100644 --- a/test/error_info_rv_const_test.cpp +++ b/test/error_info_rv_const_test.cpp @@ -3,26 +3,26 @@ //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) -#include "boost/exception/info.hpp" +#include #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES int main() - { - return 0; - } + { + return 0; + } #else template I const rv_const( I i ) - { - return i; - } + { + return i; + } template E const & add_info( E const & e, I i ) - { - return e << rv_const(i); - } + { + return e << rv_const(i); + } #include "error_info_test.hpp" #endif diff --git a/test/error_info_rv_test.cpp b/test/error_info_rv_test.cpp index 433be92..3c8c718 100644 --- a/test/error_info_rv_test.cpp +++ b/test/error_info_rv_test.cpp @@ -3,20 +3,20 @@ //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) -#include "boost/exception/info.hpp" +#include #ifdef BOOST_NO_CXX11_RVALUE_REFERENCES int main() - { - return 0; - } + { + return 0; + } #else template E const & add_info( E const & e, I i ) - { - return e << std::move(i); - } + { + return e << std::move(i); + } #include "error_info_test.hpp" #endif