From 2b34e74562ed3f004371d85daf31736cf39d74a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 11 Nov 2013 22:21:22 +0000 Subject: [PATCH] Fixes #9332 [SVN r86626] --- .../has_member_function_callable_with.hpp | 13 +++++++++++-- test/has_member_function_callable_with.cpp | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/include/boost/intrusive/detail/has_member_function_callable_with.hpp b/include/boost/intrusive/detail/has_member_function_callable_with.hpp index be4a015..d86231c 100644 --- a/include/boost/intrusive/detail/has_member_function_callable_with.hpp +++ b/include/boost/intrusive/detail/has_member_function_callable_with.hpp @@ -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 struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) { + #ifndef BOOST_NO_CXX11_DECLTYPE + template().BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME()) > + static boost_intrusive_has_member_function_callable_with::yes_type Test(Fun*); + #else template - 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) Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)*); - + #endif + template static boost_intrusive_has_member_function_callable_with::no_type Test(...); diff --git a/test/has_member_function_callable_with.cpp b/test/has_member_function_callable_with.cpp index 96b822e..0036c3f 100644 --- a/test/has_member_function_callable_with.cpp +++ b/test/has_member_function_callable_with.cpp @@ -68,7 +68,7 @@ class has_member_function_named_func }}} -#if !defined(BOOST_CONTAINER_PERFECT_FORWARDING) +#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING) namespace boost{ namespace intrusive{ @@ -259,7 +259,7 @@ class has_member_function_named_func }}} -#else +#else //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING) namespace boost{ namespace intrusive{ @@ -283,6 +283,7 @@ class has_member_function_named_func namespace intrusive{ namespace intrusive_detail{ + #ifdef BOOST_NO_CXX11_DECLTYPE template().func(), 0)> struct zeroarg_checker_func { @@ -299,12 +300,19 @@ class has_member_function_named_func zeroarg_checker_func(int); }; + #endif //BOOST_NO_CXX11_DECLTYPE + template struct has_member_function_callable_with_func_impl { - template - static zeroarg_checker_func Test(zeroarg_checker_func*); + #ifndef BOOST_NO_CXX11_DECLTYPE + template().func()) > + static boost_intrusive_has_member_function_callable_with::yes_type Test(U*); + #else + template + static zeroarg_checker_func Test(zeroarg_checker_func*); + #endif template static has_member_function_callable_with::no_type Test(...); @@ -356,7 +364,7 @@ class has_member_function_named_func }}} -#endif +#endif //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING) struct functor {