|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66363 - sandbox/function/boost/function
From: dsaritz_at_[hidden]
Date: 2010-11-02 16:16:31
Author: psiha
Date: 2010-11-02 16:16:26 EDT (Tue, 02 Nov 2010)
New Revision: 66363
URL: http://svn.boost.org/trac/boost/changeset/66363
Log:
Removed last remains of 'unifdefed' SFINAE usage.
Text files modified:
sandbox/function/boost/function/function_base.hpp | 9 ++++++---
sandbox/function/boost/function/function_template.hpp | 30 +++++++++++++++++++++++-------
2 files changed, 29 insertions(+), 10 deletions(-)
Modified: sandbox/function/boost/function/function_base.hpp
==============================================================================
--- sandbox/function/boost/function/function_base.hpp (original)
+++ sandbox/function/boost/function/function_base.hpp 2010-11-02 16:16:26 EDT (Tue, 02 Nov 2010)
@@ -1511,6 +1511,9 @@
};
+
+#ifndef BOOST_NO_SFINAE
+
#define BOOST_FUNCTION_ENABLE_IF_FUNCTION \
template <class Function> \
typename enable_if \
@@ -1519,7 +1522,6 @@
bool \
>::type
-#ifndef BOOST_NO_SFINAE
BOOST_FUNCTION_ENABLE_IF_FUNCTION
inline operator==(const Function& f, detail::function::useless_clear_type*)
{
@@ -1543,7 +1545,9 @@
{
return !f.empty();
}
-#endif
+
+#undef BOOST_FUNCTION_ENABLE_IF_FUNCTION
+#endif // BOOST_NO_SFINAE
#ifdef BOOST_NO_SFINAE
// Comparisons between boost::function objects and arbitrary function objects
@@ -1800,7 +1804,6 @@
#undef BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL
#undef BOOST_FUNCTION_COMPARE_TYPE_ID
-#undef BOOST_FUNCTION_ENABLE_IF_FUNCTION
//...zzz...required in function_template.hpp #undef BOOST_FUNCTION_CLANG_AND_OLD_GCC_BROKEN_STATIC_ASSERT
#undef BF_VT_REF
#undef BF_VT_DEREF
Modified: sandbox/function/boost/function/function_template.hpp
==============================================================================
--- sandbox/function/boost/function/function_template.hpp (original)
+++ sandbox/function/boost/function/function_template.hpp 2010-11-02 16:16:26 EDT (Tue, 02 Nov 2010)
@@ -522,15 +522,22 @@
// a possible exception being the case of an empty source as empty handler vtables depend on the
// policy as well as the signature).
template <typename Allocator, typename ActualFunctor>
- static vtable_type const & vtable_for_functor( BOOST_FUNCTION_FUNCTION const & functor )
+ static vtable_type const & vtable_for_functor_aux
+ (
+ mpl::true_, // is a boost::function<>
+ BOOST_FUNCTION_FUNCTION const & functor
+ )
{
BOOST_STATIC_ASSERT(( is_base_of<BOOST_FUNCTION_FUNCTION, ActualFunctor>::value ));
return functor.get_vtable();
}
template <typename Allocator, typename ActualFunctor, typename StoredFunctor>
- typename disable_if<is_base_of<BOOST_FUNCTION_FUNCTION, StoredFunctor>, vtable_type const &>::type
- static vtable_for_functor( StoredFunctor const & /*functor*/ )
+ static vtable_type const & vtable_for_functor_aux
+ (
+ mpl::false_, // is a boost::function<>
+ StoredFunctor const & /*functor*/
+ )
{
using namespace detail::function;
@@ -584,6 +591,15 @@
return vtable_holder<invoker_type, manager_type, is_empty_handler>::stored_vtable;
}
+ template <typename Allocator, typename ActualFunctor, typename StoredFunctor>
+ static vtable_type const & vtable_for_functor( StoredFunctor const & functor )
+ {
+ return vtable_for_functor_aux<Allocator, ActualFunctor>
+ (
+ is_base_of<BOOST_FUNCTION_FUNCTION, StoredFunctor>(),
+ functor
+ );
+ }
// ...direct actually means whether to skip pre-destruction (when not
// assigning but constructing) so it should probably be renamed to
@@ -759,10 +775,10 @@
template<typename Functor>
#ifndef BOOST_NO_SFINAE
- typename enable_if_c<
- (boost::type_traits::ice_not<
- (is_integral<Functor>::value)>::value),
- self_type&>::type
+ typename enable_if_c<
+ (boost::type_traits::ice_not<
+ (is_integral<Functor>::value)>::value),
+ self_type&>::type
#else
self_type&
#endif
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