2 // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3 // Hinnant & John Maddock 2000.
4 // Use, modification and distribution are subject to the Boost Software License,
5 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt).
8 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
11 #ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
12 #define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
14 #include <boost/type_traits/detail/config.hpp>
15 #include <boost/detail/workaround.hpp>
17 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
19 // Note: we use the "workaround" version for MSVC because it works for
20 // __stdcall etc function types, where as the partial specialisation
21 // version does not do so.
23 # include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
24 # include <boost/type_traits/remove_cv.hpp>
25 # include <boost/type_traits/integral_constant.hpp>
27 # include <boost/type_traits/is_reference.hpp>
28 # include <boost/type_traits/is_array.hpp>
29 # include <boost/type_traits/detail/yes_no_type.hpp>
30 # include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
35 #if defined( __CODEGEARC__ )
36 template <class T> struct is_member_function_pointer : public integral_constant<bool, __is_member_function_pointer( T )> {};
37 #elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
39 template <class T> struct is_member_function_pointer
40 : public ::boost::integral_constant<bool, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value>{};
49 struct is_mem_fun_pointer_select
51 template <class T> struct result_ : public false_type{};
55 struct is_mem_fun_pointer_select<false>
57 template <typename T> struct result_
59 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
61 #pragma warning(disable:6334)
64 typedef result_<T> self_type;
66 BOOST_STATIC_CONSTANT(
68 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
70 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
77 struct is_member_function_pointer_impl
78 : public is_mem_fun_pointer_select<
79 ::boost::is_reference<T>::value || ::boost::is_array<T>::value>::template result_<T>{};
82 struct is_member_function_pointer_impl<T&> : public false_type{};
87 struct is_member_function_pointer_impl
90 BOOST_STATIC_CONSTANT(
92 (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
96 struct is_member_function_pointer_impl<T&>
98 BOOST_STATIC_CONSTANT(bool, value = false);
103 template<> struct is_member_function_pointer_impl<void> : public false_type{};
104 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
105 template<> struct is_member_function_pointer_impl<void const> : public false_type{};
106 template<> struct is_member_function_pointer_impl<void const volatile> : public false_type{};
107 template<> struct is_member_function_pointer_impl<void volatile> : public false_type{};
110 } // namespace detail
113 struct is_member_function_pointer
114 : public integral_constant<bool, ::boost::detail::is_member_function_pointer_impl<T>::value>{};
120 #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED