[SVN r86626]
This commit is contained in:
Ion Gaztañaga
2013-11-11 22:21:22 +00:00
parent 02ddd12716
commit 2b34e74562
2 changed files with 24 additions and 7 deletions

View File

@@ -195,6 +195,8 @@
static const bool value = false; static const bool value = false;
}; };
#ifdef BOOST_NO_CXX11_DECLTYPE
//Special case for 0 args //Special case for 0 args
template< class F template< class F
, std::size_t N = , std::size_t N =
@@ -215,13 +217,20 @@
BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int); BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)(int);
}; };
#endif //#ifdef BOOST_NO_CXX11_DECLTYPE
template<typename Fun> template<typename Fun>
struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl) struct BOOST_PP_CAT(BOOST_PP_CAT(has_member_function_callable_with_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME),_impl)
<Fun, true> <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> 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>*); <U> Test(BOOST_PP_CAT(zeroarg_checker_, BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME)<U>*);
#endif
template <class U> template <class U>
static boost_intrusive_has_member_function_callable_with::no_type Test(...); static boost_intrusive_has_member_function_callable_with::no_type Test(...);

View File

@@ -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 boost{
namespace intrusive{ namespace intrusive{
@@ -259,7 +259,7 @@ class has_member_function_named_func
}}} }}}
#else #else //#if !defined(BOOST_INTRUSIVE_PERFECT_FORWARDING)
namespace boost{ namespace boost{
namespace intrusive{ namespace intrusive{
@@ -283,6 +283,7 @@ class has_member_function_named_func
namespace intrusive{ namespace intrusive{
namespace intrusive_detail{ namespace intrusive_detail{
#ifdef BOOST_NO_CXX11_DECLTYPE
template<class F, std::size_t N = sizeof(boost::move_detail::declval<F>().func(), 0)> template<class F, std::size_t N = sizeof(boost::move_detail::declval<F>().func(), 0)>
struct zeroarg_checker_func struct zeroarg_checker_func
{ {
@@ -299,12 +300,19 @@ class has_member_function_named_func
zeroarg_checker_func(int); zeroarg_checker_func(int);
}; };
#endif //BOOST_NO_CXX11_DECLTYPE
template<typename Fun> template<typename Fun>
struct has_member_function_callable_with_func_impl struct has_member_function_callable_with_func_impl
<Fun, true> <Fun, true>
{ {
template<class U> #ifndef BOOST_NO_CXX11_DECLTYPE
static zeroarg_checker_func<U> Test(zeroarg_checker_func<U>*); 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> template <class U>
static has_member_function_callable_with::no_type Test(...); 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 struct functor
{ {