From e1378f7aef652e8c88edf5986bad6b6c645bfe2e Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Wed, 26 Oct 2016 11:51:40 -0700 Subject: [PATCH] Ticket #12553, plus tabs converted to spaces. --- .../exception/detail/error_info_impl.hpp | 4 +- include/boost/exception/info.hpp | 168 +++++++++--------- test/N3757_test.cpp | 2 +- test/error_info_lv_const_test.cpp | 6 +- test/error_info_lv_test.cpp | 6 +- test/error_info_rv_const_test.cpp | 18 +- test/error_info_rv_test.cpp | 12 +- 7 files changed, 108 insertions(+), 108 deletions(-) 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/info.hpp b/include/boost/exception/info.hpp index 28a8ecf..4e5778e 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -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 + 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 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..f304e6d 100644 --- a/test/error_info_lv_const_test.cpp +++ b/test/error_info_lv_const_test.cpp @@ -7,7 +7,7 @@ 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..3f3c8f6 100644 --- a/test/error_info_lv_test.cpp +++ b/test/error_info_lv_test.cpp @@ -7,7 +7,7 @@ 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..cd01927 100644 --- a/test/error_info_rv_const_test.cpp +++ b/test/error_info_rv_const_test.cpp @@ -8,21 +8,21 @@ #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..a47f282 100644 --- a/test/error_info_rv_test.cpp +++ b/test/error_info_rv_test.cpp @@ -8,15 +8,15 @@ #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