mirror of
https://github.com/boostorg/function.git
synced 2025-07-30 04:47:14 +02:00
Make Boost.Function compile with disabled exceptions.
Closes #2900. Patch from Gabi Davar. [SVN r53722]
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
// Note: this header is a header template and must NOT have multiple-inclusion
|
// Note: this header is a header template and must NOT have multiple-inclusion
|
||||||
// protection.
|
// protection.
|
||||||
#include <boost/function/detail/prologue.hpp>
|
#include <boost/function/detail/prologue.hpp>
|
||||||
|
#include <boost/detail/no_exceptions_support.hpp>
|
||||||
|
|
||||||
#if defined(BOOST_MSVC)
|
#if defined(BOOST_MSVC)
|
||||||
# pragma warning( push )
|
# pragma warning( push )
|
||||||
@ -786,24 +787,26 @@ namespace boost {
|
|||||||
operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
operator=(Functor BOOST_FUNCTION_TARGET_FIX(const &) f)
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
try {
|
BOOST_TRY {
|
||||||
this->assign_to(f);
|
this->assign_to(f);
|
||||||
} catch (...) {
|
} BOOST_CATCH (...) {
|
||||||
vtable = 0;
|
vtable = 0;
|
||||||
throw;
|
BOOST_RETHROW;
|
||||||
}
|
}
|
||||||
|
BOOST_CATCH_END
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
template<typename Functor,typename Allocator>
|
template<typename Functor,typename Allocator>
|
||||||
void assign(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a)
|
void assign(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a)
|
||||||
{
|
{
|
||||||
this->clear();
|
this->clear();
|
||||||
try {
|
BOOST_TRY{
|
||||||
this->assign_to_a(f,a);
|
this->assign_to_a(f,a);
|
||||||
} catch (...) {
|
} BOOST_CATCH (...) {
|
||||||
vtable = 0;
|
vtable = 0;
|
||||||
throw;
|
BOOST_RETHROW;
|
||||||
}
|
}
|
||||||
|
BOOST_CATCH_END
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef BOOST_NO_SFINAE
|
#ifndef BOOST_NO_SFINAE
|
||||||
@ -828,12 +831,13 @@ namespace boost {
|
|||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
this->clear();
|
this->clear();
|
||||||
try {
|
BOOST_TRY {
|
||||||
this->assign_to_own(f);
|
this->assign_to_own(f);
|
||||||
} catch (...) {
|
} BOOST_CATCH (...) {
|
||||||
vtable = 0;
|
vtable = 0;
|
||||||
throw;
|
BOOST_RETHROW;
|
||||||
}
|
}
|
||||||
|
BOOST_CATCH_END
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -965,9 +969,7 @@ namespace boost {
|
|||||||
if (&f == this)
|
if (&f == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
BOOST_TRY {
|
||||||
try {
|
|
||||||
#endif
|
|
||||||
if (!f.empty()) {
|
if (!f.empty()) {
|
||||||
this->vtable = f.vtable;
|
this->vtable = f.vtable;
|
||||||
if (this->has_trivial_copy_and_destroy())
|
if (this->has_trivial_copy_and_destroy())
|
||||||
@ -979,12 +981,11 @@ namespace boost {
|
|||||||
} else {
|
} else {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
} BOOST_CATCH (...) {
|
||||||
} catch (...) {
|
|
||||||
vtable = 0;
|
vtable = 0;
|
||||||
throw;
|
BOOST_RETHROW;
|
||||||
}
|
}
|
||||||
#endif
|
BOOST_CATCH_END
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user