Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86626 - in trunk: boost/intrusive/detail libs/intrusive/test
From: igaztanaga_at_[hidden]
Date: 2013-11-11 17:21:22


Author: igaztanaga
Date: 2013-11-11 17:21:22 EST (Mon, 11 Nov 2013)
New Revision: 86626
URL: http://svn.boost.org/trac/boost/changeset/86626

Log:
Fixes #9332

Text files modified:
   trunk/boost/intrusive/detail/has_member_function_callable_with.hpp | 13 +++++++++++--
   trunk/libs/intrusive/test/has_member_function_callable_with.cpp | 18 +++++++++++++-----
   2 files changed, 24 insertions(+), 7 deletions(-)

Modified: trunk/boost/intrusive/detail/has_member_function_callable_with.hpp
==============================================================================
--- trunk/boost/intrusive/detail/has_member_function_callable_with.hpp Mon Nov 11 17:12:13 2013 (r86625)
+++ trunk/boost/intrusive/detail/has_member_function_callable_with.hpp 2013-11-11 17:21:22 EST (Mon, 11 Nov 2013) (r86626)
@@ -195,6 +195,8 @@
             static const bool value = false;
          };
 
+ #ifdef BOOST_NO_CXX11_DECLTYPE
+
          //Special case for 0 args
          template< class F
                , std::size_t N =
@@ -215,14 +217,21 @@
             BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int);
          };
 
+ #endif //#ifdef BOOST_NO_CXX11_DECLTYPE
+
          template<typename Fun>
          struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl)
             <Fun, true>
          {
+ #ifndef BOOST_NO_CXX11_DECLTYPE
+ template<class U, class V = decltype(boost::move_detail::declval<Fun>().BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME()) >
+ static boost_intrusive_has_member_function_callable_with::yes_type Test(Fun*);
+ #else
             template<class U>
- static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
+ static BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)
                <U> Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
-
+ #endif
+
             template <class U>
             static boost_intrusive_has_member_function_callable_with::no_type Test(...);
 

Modified: trunk/libs/intrusive/test/has_member_function_callable_with.cpp
==============================================================================
--- trunk/libs/intrusive/test/has_member_function_callable_with.cpp Mon Nov 11 17:12:13 2013 (r86625)
+++ trunk/libs/intrusive/test/has_member_function_callable_with.cpp 2013-11-11 17:21:22 EST (Mon, 11 Nov 2013) (r86626)
@@ -68,7 +68,7 @@
 
 }}}
 
-#if !defined(BOOST_CONTAINER_PERFECT_FORWARDING)
+#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
 
    namespace boost{
    namespace intrusive{
@@ -259,7 +259,7 @@
 
    }}}
 
-#else
+#else //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
 
    namespace boost{
    namespace intrusive{
@@ -283,6 +283,7 @@
    namespace intrusive{
    namespace intrusive_detail{
 
+ #ifdef BOOST_NO_CXX11_DECLTYPE
    template<class F, std::size_t N = sizeof(boost::move_detail::declval<F>().func(), 0)>
    struct zeroarg_checker_func
    {
@@ -299,12 +300,19 @@
       zeroarg_checker_func(int);
    };
 
+ #endif //BOOST_NO_CXX11_DECLTYPE
+
    template<typename Fun>
    struct has_member_function_callable_with_func_impl
       <Fun, true>
    {
- template<class U>
- static zeroarg_checker_func<U> Test(zeroarg_checker_func<U>*);
+ #ifndef BOOST_NO_CXX11_DECLTYPE
+ template<class U, class V = decltype(boost::move_detail::declval<Fun>().func()) >
+ static boost_intrusive_has_member_function_callable_with::yes_type Test(U*);
+ #else
+ template<class U>
+ static zeroarg_checker_func<U> Test(zeroarg_checker_func<U>*);
+ #endif
 
       template <class U>
       static has_member_function_callable_with::no_type Test(...);
@@ -356,7 +364,7 @@
 
    }}}
 
-#endif
+#endif //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
 
 struct functor
 {


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