From 972667f52e9a79536f10bed5032f1a5afc294238 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 3 Jan 2017 14:35:11 -0800 Subject: [PATCH] Tweaks to try to defeat g++4.6.3 --- .../exception/detail/error_info_impl.hpp | 31 +++++++++------ include/boost/exception/info.hpp | 39 ------------------- test/error_info_basic_test.cpp | 20 +++++----- 3 files changed, 29 insertions(+), 61 deletions(-) diff --git a/include/boost/exception/detail/error_info_impl.hpp b/include/boost/exception/detail/error_info_impl.hpp index ed593be..479ef54 100644 --- a/include/boost/exception/detail/error_info_impl.hpp +++ b/include/boost/exception/detail/error_info_impl.hpp @@ -44,37 +44,44 @@ boost public exception_detail::error_info_base { public: - typedef T value_type; - - error_info( value_type const & v ); + error_info( value_type const & v ): + v_(v) + { + } #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - error_info( error_info const & ); - error_info( value_type && v ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(v)))); - error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.v_)))); + error_info( error_info const & x ): + v_(x.v_) + { + } + error_info( value_type && v ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(v)))): + v_(std::move(v)) + { + } + error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.v_)))): + v_(std::move(x.v_)) + { + } #endif - ~error_info() throw(); - + ~error_info() throw() + { + } value_type const & value() const { return v_; } - value_type & 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 v_; }; } diff --git a/include/boost/exception/info.hpp b/include/boost/exception/info.hpp index 5b7c17b..71abe53 100644 --- a/include/boost/exception/info.hpp +++ b/include/boost/exception/info.hpp @@ -38,45 +38,6 @@ boost return '[' + error_info_name(x) + "] = " + to_string_stub(x.value()) + '\n'; } - template - inline - error_info:: - error_info( value_type const & v ): - v_(v) - { - } - -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - template - inline - error_info:: - error_info( error_info const & x ): - v_(x.v_) - { - } - template - inline - error_info:: - error_info( value_type && v ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(v)))): - v_(std::move(v)) - { - } - template - inline - error_info:: - error_info( error_info && x ) BOOST_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(value_type(std::move(x.v_)))): - v_(std::move(x.v_)) - { - } -#endif - - template - inline - error_info:: - ~error_info() throw() - { - } - template inline std::string diff --git a/test/error_info_basic_test.cpp b/test/error_info_basic_test.cpp index 021eabc..aa8d6a7 100644 --- a/test/error_info_basic_test.cpp +++ b/test/error_info_basic_test.cpp @@ -16,14 +16,14 @@ typedef boost::error_info error_info_str int main() - { - try - { - throw my_exception() << error_info_string("doh"); - } - catch( my_exception & e ) - { - BOOST_TEST(boost::get_error_info(e) && !strcmp(boost::get_error_info(e)->c_str(),"doh")); - } + { + try + { + throw my_exception() << error_info_string("doh"); + } + catch( my_exception & e ) + { + BOOST_TEST(boost::get_error_info(e) && !strcmp(boost::get_error_info(e)->c_str(),"doh")); + } return 0; - } + }