2 // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3 // Hinnant & John Maddock 2000. Permission to copy, use, modify,
4 // sell and distribute this software is granted provided this
5 // copyright notice appears in all copies. This software is provided
6 // "as is" without express or implied warranty, and with no claim as
7 // to its suitability for any purpose.
9 // See http://www.boost.org for most recent version including documentation.
11 #ifndef BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
12 #define BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED
14 #include "boost/type_traits/config.hpp"
16 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
17 # include "boost/type_traits/is_member_function_pointer.hpp"
19 # include "boost/type_traits/is_reference.hpp"
20 # include "boost/type_traits/is_array.hpp"
21 # include "boost/type_traits/detail/is_mem_fun_pointer_tester.hpp"
22 # include "boost/type_traits/detail/yes_no_type.hpp"
23 # include "boost/type_traits/detail/false_result.hpp"
24 # include "boost/type_traits/detail/ice_or.hpp"
27 // should be the last #include
28 #include "boost/type_traits/detail/bool_trait_def.hpp"
32 #if defined(__BORLANDC__)
33 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,false)
34 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
36 #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
37 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value)
38 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
40 #else // no partial template specialization
44 template <typename R, typename T>
45 ::boost::type_traits::yes_type BOOST_TT_DECL is_member_pointer_tester(R T::*);
46 ::boost::type_traits::no_type BOOST_TT_DECL is_member_pointer_tester(...);
49 struct is_member_pointer_select
50 : ::boost::type_traits::false_result
55 struct is_member_pointer_select<false>
57 template <typename T> struct result_
60 BOOST_STATIC_CONSTANT(
62 (::boost::type_traits::ice_or<
63 (1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(make_t()))),
64 (1 == sizeof(is_member_pointer_tester(make_t())))
70 struct is_member_pointer_impl
71 : is_member_pointer_select<
72 ::boost::type_traits::ice_or<
73 ::boost::is_reference<T>::value
74 , ::boost::is_array<T>::value
76 >::template result_<T>
80 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void,false)
81 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
82 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void const,false)
83 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void volatile,false)
84 BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_pointer,void const volatile,false)
89 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::detail::is_member_pointer_impl<T>::value)
91 #endif // __BORLANDC__
95 #include "boost/type_traits/detail/bool_trait_undef.hpp"
97 #endif // BOOST_TT_IS_MEMBER_POINTER_HPP_INCLUDED