fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / type_traits / is_member_function_pointer.hpp
1
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).
7 //
8 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
9
10
11 #ifndef DYN_DETAIL_BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
12 #define DYN_DETAIL_BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
13
14 #include <dyn_detail/boost/type_traits/config.hpp>
15 #include <dyn_detail/boost/detail/workaround.hpp>
16
17 #if !defined(DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
18    && !DYN_DETAIL_BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(DYN_DETAIL_BOOST_TT_TEST_MS_FUNC_SIGS)
19    //
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.
23    //
24 #   include <dyn_detail/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
25 #   include <dyn_detail/boost/type_traits/remove_cv.hpp>
26 #else
27 #   include <dyn_detail/boost/type_traits/is_reference.hpp>
28 #   include <dyn_detail/boost/type_traits/is_array.hpp>
29 #   include <dyn_detail/boost/type_traits/detail/yes_no_type.hpp>
30 #   include <dyn_detail/boost/type_traits/detail/false_result.hpp>
31 #   include <dyn_detail/boost/type_traits/detail/ice_or.hpp>
32 #   include <dyn_detail/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
33 #endif
34
35 // should be the last #include
36 #include <dyn_detail/boost/type_traits/detail/bool_trait_def.hpp>
37
38 namespace dyn_detail {
39 namespace boost {
40
41 #if defined( __CODEGEARC__ )
42 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,__is_member_function_pointer( T ))
43 #elif !defined(DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !DYN_DETAIL_BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(DYN_DETAIL_BOOST_TT_TEST_MS_FUNC_SIGS)
44
45 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(
46       is_member_function_pointer
47     , T
48     , ::dyn_detail::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value
49     )
50
51 #else
52
53 namespace detail {
54
55 #ifndef __BORLANDC__
56
57 template <bool>
58 struct is_mem_fun_pointer_select
59     : ::dyn_detail::boost::type_traits::false_result
60 {
61 };
62
63 template <>
64 struct is_mem_fun_pointer_select<false>
65 {
66     template <typename T> struct result_
67     {
68 #if DYN_DETAIL_BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
69 #pragma warning(push)
70 #pragma warning(disable:6334)
71 #endif
72         static T* make_t;
73         typedef result_<T> self_type;
74
75         DYN_DETAIL_BOOST_STATIC_CONSTANT(
76             bool, value = (
77                 1 == sizeof(::dyn_detail::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
78             ));
79 #if DYN_DETAIL_BOOST_WORKAROUND(_MSC_FULL_VER, >= 140050000)
80 #pragma warning(pop)
81 #endif
82     };
83 };
84
85 template <typename T>
86 struct is_member_function_pointer_impl
87     : is_mem_fun_pointer_select<
88           ::dyn_detail::boost::type_traits::ice_or<
89               ::dyn_detail::boost::is_reference<T>::value
90             , ::dyn_detail::boost::is_array<T>::value
91             >::value
92         >::template result_<T>
93 {
94 };
95
96 #ifndef DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
97 template <typename T>
98 struct is_member_function_pointer_impl<T&> : public false_type{};
99 #endif
100
101 #else // Borland C++
102
103 template <typename T>
104 struct is_member_function_pointer_impl
105 {
106    static T* m_t;
107    DYN_DETAIL_BOOST_STATIC_CONSTANT(
108               bool, value =
109                (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
110 };
111
112 template <typename T>
113 struct is_member_function_pointer_impl<T&>
114 {
115    DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, value = false);
116 };
117
118 #endif
119
120 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void,false)
121 #ifndef DYN_DETAIL_BOOST_NO_CV_VOID_SPECIALIZATIONS
122 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const,false)
123 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void volatile,false)
124 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const volatile,false)
125 #endif
126
127 } // namespace detail
128
129 DYN_DETAIL_BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::dyn_detail::boost::detail::is_member_function_pointer_impl<T>::value)
130
131 #endif // DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
132
133 } // namespace boost
134 } // namespace dyn_detail
135
136 #include <dyn_detail/boost/type_traits/detail/bool_trait_undef.hpp>
137
138 #endif // DYN_DETAIL_BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED