Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53722 - trunk/boost/function
From: ghost_at_[hidden]
Date: 2009-06-07 11:44:51


Author: vladimir_prus
Date: 2009-06-07 11:44:50 EDT (Sun, 07 Jun 2009)
New Revision: 53722
URL: http://svn.boost.org/trac/boost/changeset/53722

Log:
Make Boost.Function compile with disabled exceptions.

Closes #2900. Patch from Gabi Davar.

Text files modified:
   trunk/boost/function/function_template.hpp | 33 +++++++++++++++++----------------
   1 files changed, 17 insertions(+), 16 deletions(-)

Modified: trunk/boost/function/function_template.hpp
==============================================================================
--- trunk/boost/function/function_template.hpp (original)
+++ trunk/boost/function/function_template.hpp 2009-06-07 11:44:50 EDT (Sun, 07 Jun 2009)
@@ -11,6 +11,7 @@
 // Note: this header is a header template and must NOT have multiple-inclusion
 // protection.
 #include <boost/function/detail/prologue.hpp>
+#include <boost/detail/no_exceptions_support.hpp>
 
 #if defined(BOOST_MSVC)
 # pragma warning( push )
@@ -786,24 +787,26 @@
     operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
     {
       this->clear();
- try {
+ BOOST_TRY {
         this->assign_to(f);
- } catch (...) {
+ } BOOST_CATCH (...) {
         vtable = 0;
- throw;
+ BOOST_RETHROW;
       }
+ BOOST_CATCH_END
       return *this;
     }
     template<typename Functor,typename Allocator>
     void assign(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a)
     {
       this->clear();
- try {
+ BOOST_TRY{
         this->assign_to_a(f,a);
- } catch (...) {
+ } BOOST_CATCH (...) {
         vtable = 0;
- throw;
+ BOOST_RETHROW;
       }
+ BOOST_CATCH_END
     }
 
 #ifndef BOOST_NO_SFINAE
@@ -828,12 +831,13 @@
         return *this;
 
       this->clear();
- try {
+ BOOST_TRY {
         this->assign_to_own(f);
- } catch (...) {
+ } BOOST_CATCH (...) {
         vtable = 0;
- throw;
+ BOOST_RETHROW;
       }
+ BOOST_CATCH_END
       return *this;
     }
 
@@ -965,9 +969,7 @@
       if (&f == this)
         return;
 
-#if !defined(BOOST_NO_EXCEPTIONS)
- try {
-#endif
+ BOOST_TRY {
         if (!f.empty()) {
           this->vtable = f.vtable;
           if (this->has_trivial_copy_and_destroy())
@@ -979,12 +981,11 @@
         } else {
           clear();
         }
-#if !defined(BOOST_NO_EXCEPTIONS)
- } catch (...) {
+ } BOOST_CATCH (...) {
         vtable = 0;
- throw;
+ BOOST_RETHROW;
       }
-#endif
+ BOOST_CATCH_END
     }
   };
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk