]> git.lyx.org Git - lyx.git/blob - 3rdparty/boost/boost/type_traits/detail/is_member_function_pointer_cxx_03.hpp
Update to boost 1.72
[lyx.git] / 3rdparty / boost / boost / type_traits / detail / is_member_function_pointer_cxx_03.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 BOOST_TT_IS_MEMBER_FUNCTION_POINTER_CXX_03_HPP_INCLUDED
12 #define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_CXX_03_HPP_INCLUDED
13
14 #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
15    //
16    // Note: we use the "workaround" version for MSVC because it works for 
17    // __stdcall etc function types, where as the partial specialisation
18    // version does not do so.
19    //
20 #   include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
21 #   include <boost/type_traits/remove_cv.hpp>
22 #   include <boost/type_traits/integral_constant.hpp>
23 #else
24 #   include <boost/type_traits/is_reference.hpp>
25 #   include <boost/type_traits/is_array.hpp>
26 #   include <boost/type_traits/detail/yes_no_type.hpp>
27 #   include <boost/type_traits/detail/is_mem_fun_pointer_tester.hpp>
28 #endif
29
30 namespace boost {
31
32 #if defined( __CODEGEARC__ )
33 template <class T> struct is_member_function_pointer : public integral_constant<bool, __is_member_function_pointer( T )> {};
34 #elif !BOOST_WORKAROUND(__BORLANDC__, < 0x600) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
35
36 template <class T> struct is_member_function_pointer 
37    : public ::boost::integral_constant<bool, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value>{};
38
39 #else
40
41 namespace detail {
42
43 #ifndef __BORLANDC__
44
45 template <bool>
46 struct is_mem_fun_pointer_select
47 {
48    template <class T> struct result_ : public false_type{};
49 };
50
51 template <>
52 struct is_mem_fun_pointer_select<false>
53 {
54     template <typename T> struct result_
55     {
56 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
57 #pragma warning(push)
58 #pragma warning(disable:6334)
59 #endif
60         static T* make_t;
61         typedef result_<T> self_type;
62
63         BOOST_STATIC_CONSTANT(
64             bool, value = (
65                 1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
66             ));
67 #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000)
68 #pragma warning(pop)
69 #endif
70     };
71 };
72
73 template <typename T>
74 struct is_member_function_pointer_impl
75     : public is_mem_fun_pointer_select< 
76       ::boost::is_reference<T>::value || ::boost::is_array<T>::value>::template result_<T>{};
77
78 template <typename T>
79 struct is_member_function_pointer_impl<T&> : public false_type{};
80
81 #else // Borland C++
82
83 template <typename T>
84 struct is_member_function_pointer_impl
85 {
86    static T* m_t;
87    BOOST_STATIC_CONSTANT(
88               bool, value =
89                (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
90 };
91
92 template <typename T>
93 struct is_member_function_pointer_impl<T&>
94 {
95    BOOST_STATIC_CONSTANT(bool, value = false);
96 };
97
98 #endif
99
100 template<> struct is_member_function_pointer_impl<void> : public false_type{};
101 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
102 template<> struct is_member_function_pointer_impl<void const> : public false_type{};
103 template<> struct is_member_function_pointer_impl<void const volatile> : public false_type{};
104 template<> struct is_member_function_pointer_impl<void volatile> : public false_type{};
105 #endif
106
107 } // namespace detail
108
109 template <class T>
110 struct is_member_function_pointer
111    : public integral_constant<bool, ::boost::detail::is_member_function_pointer_impl<T>::value>{};
112
113 #endif
114
115 } // namespace boost
116
117 #endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED