From 3890c238eb00a041a1eb6da08bf601652a694a96 Mon Sep 17 00:00:00 2001 From: Ribulous Barnulous Date: Sat, 21 Mar 2015 09:19:36 -0400 Subject: [PATCH 1/2] added support for error_info r-value references --- include/boost/exception/exception.hpp | 54 +++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index d762cf8..e930f81 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -197,8 +197,23 @@ boost template E const & set_info( E const &, throw_line const & ); + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template + E const & set_info( E const &, error_info && ); + + template + E const & set_info( E const &, throw_function && ); + + template + E const & set_info( E const &, throw_file && ); + + template + E const & set_info( E const &, throw_line && ); +#endif } + #if defined(__GNUC__) # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) # pragma GCC visibility push (default) @@ -257,6 +272,20 @@ boost template friend E const & exception_detail::set_info( E const &, error_info const & ); +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template + friend E const & exception_detail::set_info( E const &, throw_function && ); + + template + friend E const & exception_detail::set_info( E const &, throw_file && ); + + template + friend E const & exception_detail::set_info( E const &, throw_line && ); + + template + friend E const & exception_detail::set_info( E const &, error_info && ); +#endif + friend char const * exception_detail::get_diagnostic_information( exception const &, char const * ); template @@ -309,6 +338,31 @@ boost x.throw_line_=y.v_; return x; } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + template + E const & + set_info( E const & x, throw_function && y ) + { + x.throw_function_=y.v_; + return x; + } + + template + E const & + set_info( E const & x, throw_file && y ) + { + x.throw_file_=y.v_; + return x; + } + + template + E const & + set_info( E const & x, throw_line && y ) + { + x.throw_line_=y.v_; + return x; + } +#endif } //////////////////////////////////////////////////////////////////////// From e667399ced1ea67a5d14407b3e0938ca50baacd2 Mon Sep 17 00:00:00 2001 From: Ribulous Barnulous Date: Sun, 22 Mar 2015 07:29:33 -0400 Subject: [PATCH 2/2] added include for BOOST_NO_CXX11_RVALUE_REFERENCES macro --- include/boost/exception/exception.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index e930f81..b2e1bca 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -12,6 +12,8 @@ #pragma warning(push,1) #endif +#include + namespace boost {