From e78cf0ae7a98127baf0deb13110cb72ee17556f6 Mon Sep 17 00:00:00 2001 From: Emil Dotchevski Date: Tue, 1 Dec 2009 19:48:58 +0000 Subject: [PATCH] Ticket #3211 [SVN r58088] --- include/boost/exception/exception.hpp | 62 +++++++++++++++++---------- include/boost/throw_exception.hpp | 1 + 2 files changed, 41 insertions(+), 22 deletions(-) diff --git a/include/boost/exception/exception.hpp b/include/boost/exception/exception.hpp index 7e2a0e5..3caca51 100644 --- a/include/boost/exception/exception.hpp +++ b/include/boost/exception/exception.hpp @@ -133,6 +133,15 @@ boost template E const & operator<<( E const &, error_info const & ); + template + E const & operator<<( E const &, throw_function const & ); + + template + E const & operator<<( E const &, throw_file const & ); + + template + E const & operator<<( E const &, throw_line const & ); + class exception; template @@ -205,34 +214,19 @@ boost #endif ; +#if defined(__MWERKS__) && __MWERKS__<=0x3207 + public: +#else private: template - friend - E const & - operator<<( E const & x, throw_function const & y ) - { - x.throw_function_=y.v_; - return x; - } + friend E const & operator<<( E const &, throw_function const & ); template - friend - E const & - operator<<( E const & x, throw_file const & y ) - { - x.throw_file_=y.v_; - return x; - } + friend E const & operator<<( E const &, throw_file const & ); template - friend - E const & - operator<<( E const & x, throw_line const & y ) - { - x.throw_line_=y.v_; - return x; - } + friend E const & operator<<( E const &, throw_line const & ); friend char const * exception_detail::get_diagnostic_information( exception const &, char const * ); @@ -244,7 +238,7 @@ boost friend struct exception_detail::get_info; friend struct exception_detail::get_info; friend struct exception_detail::get_info; - +#endif mutable exception_detail::refcount_ptr data_; mutable char const * throw_function_; mutable char const * throw_file_; @@ -257,6 +251,30 @@ boost { } + template + E const & + operator<<( E const & x, throw_function const & y ) + { + x.throw_function_=y.v_; + return x; + } + + template + E const & + operator<<( E const & x, throw_file const & y ) + { + x.throw_file_=y.v_; + return x; + } + + template + E const & + operator<<( E const & x, throw_line const & y ) + { + x.throw_line_=y.v_; + return x; + } + //////////////////////////////////////////////////////////////////////// namespace diff --git a/include/boost/throw_exception.hpp b/include/boost/throw_exception.hpp index 2250bef..b835004 100644 --- a/include/boost/throw_exception.hpp +++ b/include/boost/throw_exception.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )