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/config.hpp>
15 #include <boost/detail/workaround.hpp>
17 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
18 && !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
20 // Note: we use the "workaround" version for MSVC because it works for
21 // __stdcall etc function types, where as the partial specialisation
22 // version does not do so.
24 # include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
25 # include <boost/type_traits/remove_cv.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/false_result.hpp>
31 # include <boost/type_traits/detail/ice_or.hpp>
32 # include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
35 // should be the last #include
36 #include <boost/type_traits/detail/bool_trait_def.hpp>
40 #if defined( __CODEGEARC__ )
41 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,__is_member_function_pointer( T ))
42 #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
44 BOOST_TT_AUX_BOOL_TRAIT_DEF1(
45 is_member_function_pointer
47 , ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value
57 struct is_mem_fun_pointer_select
58 : ::boost::type_traits::false_result
63 struct is_mem_fun_pointer_select<false>
65 template <typename T> struct result_
67 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
69 #pragma warning(disable:6334)
72 typedef result_<T> self_type;
74 BOOST_STATIC_CONSTANT(
76 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
78 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
85 struct is_member_function_pointer_impl
86 : is_mem_fun_pointer_select<
87 ::boost::type_traits::ice_or<
88 ::boost::is_reference<T>::value
89 , ::boost::is_array<T>::value
91 >::template result_<T>
95 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
97 struct is_member_function_pointer_impl<T&> : public false_type{};
102 template <typename T>
103 struct is_member_function_pointer_impl
106 BOOST_STATIC_CONSTANT(
108 (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
111 template <typename T>
112 struct is_member_function_pointer_impl<T&>
114 BOOST_STATIC_CONSTANT(bool, value = false);
119 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void,false)
120 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
121 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const,false)
122 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void volatile,false)
123 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const volatile,false)
126 } // namespace detail
128 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_member_function_pointer_impl<T>::value)
130 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
134 #include <boost/type_traits/detail/bool_trait_undef.hpp>
136 #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED