mirror of
https://github.com/boostorg/function.git
synced 2025-08-02 06:14:56 +02:00
Merge branch 'develop'
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
// need to use std::type_info::name to compare instead of operator==.
|
// need to use std::type_info::name to compare instead of operator==.
|
||||||
#if defined( BOOST_NO_TYPEID )
|
#if defined( BOOST_NO_TYPEID )
|
||||||
# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
|
# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
|
||||||
#elif (defined(__GNUC__) && __GNUC__ >= 3) \
|
#elif defined(__GNUC__) \
|
||||||
|| defined(_AIX) \
|
|| defined(_AIX) \
|
||||||
|| ( defined(__sgi) && defined(__host_mips))
|
|| ( defined(__sgi) && defined(__host_mips))
|
||||||
# include <cstring>
|
# include <cstring>
|
||||||
@@ -66,11 +66,11 @@
|
|||||||
# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
|
# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 || defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
|
#if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
|
||||||
# define BOOST_FUNCTION_TARGET_FIX(x) x
|
# define BOOST_FUNCTION_TARGET_FIX(x) x
|
||||||
#else
|
#else
|
||||||
# define BOOST_FUNCTION_TARGET_FIX(x)
|
# define BOOST_FUNCTION_TARGET_FIX(x)
|
||||||
#endif // not MSVC
|
#endif // __ICL etc
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0)
|
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x5A0)
|
||||||
# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
||||||
@@ -661,11 +661,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename Functor>
|
template<typename Functor>
|
||||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
|
||||||
const Functor* target( Functor * = 0 ) const
|
|
||||||
#else
|
|
||||||
const Functor* target() const
|
const Functor* target() const
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if (!vtable) return 0;
|
if (!vtable) return 0;
|
||||||
|
|
||||||
@@ -683,11 +679,7 @@ public:
|
|||||||
template<typename F>
|
template<typename F>
|
||||||
bool contains(const F& f) const
|
bool contains(const F& f) const
|
||||||
{
|
{
|
||||||
#if defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
|
||||||
if (const F* fp = this->target( (F*)0 ))
|
|
||||||
#else
|
|
||||||
if (const F* fp = this->template target<F>())
|
if (const F* fp = this->template target<F>())
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
return function_equal(*fp, f);
|
return function_equal(*fp, f);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -19,8 +19,7 @@ namespace boost { namespace python { namespace objects {
|
|||||||
}}}
|
}}}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
|
#if defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
|
||||||
|| defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
|
|
||||||
|| !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
|
|| !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
|
||||||
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
|
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
|
||||||
#endif
|
#endif
|
||||||
|
@@ -935,10 +935,11 @@ namespace boost {
|
|||||||
|
|
||||||
if (stored_vtable.assign_to(f, functor)) {
|
if (stored_vtable.assign_to(f, functor)) {
|
||||||
std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
|
std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
|
||||||
|
// coverity[pointless_expression]: suppress coverity warnings on apparant if(const).
|
||||||
if (boost::has_trivial_copy_constructor<Functor>::value &&
|
if (boost::has_trivial_copy_constructor<Functor>::value &&
|
||||||
boost::has_trivial_destructor<Functor>::value &&
|
boost::has_trivial_destructor<Functor>::value &&
|
||||||
detail::function::function_allows_small_object_optimization<Functor>::value)
|
detail::function::function_allows_small_object_optimization<Functor>::value)
|
||||||
value |= static_cast<size_t>(0x01);
|
value |= static_cast<std::size_t>(0x01);
|
||||||
vtable = reinterpret_cast<detail::function::vtable_base *>(value);
|
vtable = reinterpret_cast<detail::function::vtable_base *>(value);
|
||||||
} else
|
} else
|
||||||
vtable = 0;
|
vtable = 0;
|
||||||
@@ -969,6 +970,7 @@ namespace boost {
|
|||||||
|
|
||||||
if (stored_vtable.assign_to_a(f, functor, a)) {
|
if (stored_vtable.assign_to_a(f, functor, a)) {
|
||||||
std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
|
std::size_t value = reinterpret_cast<std::size_t>(&stored_vtable.base);
|
||||||
|
// coverity[pointless_expression]: suppress coverity warnings on apparant if(const).
|
||||||
if (boost::has_trivial_copy_constructor<Functor>::value &&
|
if (boost::has_trivial_copy_constructor<Functor>::value &&
|
||||||
boost::has_trivial_destructor<Functor>::value &&
|
boost::has_trivial_destructor<Functor>::value &&
|
||||||
detail::function::function_allows_small_object_optimization<Functor>::value)
|
detail::function::function_allows_small_object_optimization<Functor>::value)
|
||||||
|
Reference in New Issue
Block a user