~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to boost/boost/type_traits/is_member_function_pointer.hpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
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.
 
8
//
 
9
// See http://www.boost.org for most recent version including documentation.
 
10
 
 
11
#ifndef BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
 
12
#define BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
 
13
 
 
14
#include "boost/type_traits/config.hpp"
 
15
 
 
16
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
 
17
#   include "boost/type_traits/detail/is_mem_fun_pointer_impl.hpp"
 
18
#else
 
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"
 
25
#endif
 
26
 
 
27
// should be the last #include
 
28
#include "boost/type_traits/detail/bool_trait_def.hpp"
 
29
 
 
30
namespace boost {
 
31
 
 
32
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
 
33
 
 
34
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
 
35
      is_member_function_pointer
 
36
    , T
 
37
    , ::boost::type_traits::is_mem_fun_pointer_impl<T>::value
 
38
    )
 
39
 
 
40
#else
 
41
 
 
42
namespace detail {
 
43
 
 
44
#ifndef __BORLANDC__
 
45
 
 
46
template <bool>
 
47
struct is_mem_fun_pointer_select
 
48
    : ::boost::type_traits::false_result
 
49
{
 
50
};
 
51
 
 
52
template <>
 
53
struct is_mem_fun_pointer_select<false>
 
54
{
 
55
    template <typename T> struct result_
 
56
    {
 
57
        static T& make_t;
 
58
        typedef result_<T> self_type;
 
59
        
 
60
        BOOST_STATIC_CONSTANT(
 
61
            bool, value = (
 
62
                1 == sizeof(::boost::type_traits::is_mem_fun_pointer_tester(self_type::make_t))
 
63
            ));
 
64
    };
 
65
};
 
66
 
 
67
template <typename T>
 
68
struct is_member_function_pointer_impl
 
69
    : is_mem_fun_pointer_select<
 
70
          ::boost::type_traits::ice_or<
 
71
              ::boost::is_reference<T>::value
 
72
            , ::boost::is_array<T>::value
 
73
            >::value
 
74
        >::template result_<T>
 
75
{
 
76
};
 
77
 
 
78
#else // Borland C++
 
79
 
 
80
template <typename T>
 
81
struct is_member_function_pointer_impl
 
82
{
 
83
   static T& m_t;
 
84
   BOOST_STATIC_CONSTANT(
 
85
              bool, value =
 
86
               (1 == sizeof(type_traits::is_mem_fun_pointer_tester(m_t))) );
 
87
};
 
88
 
 
89
template <typename T>
 
90
struct is_member_function_pointer_impl<T&>
 
91
{
 
92
   BOOST_STATIC_CONSTANT(bool, value = false);
 
93
};
 
94
 
 
95
#endif
 
96
 
 
97
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void,false)
 
98
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
 
99
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const,false)
 
100
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void volatile,false)
 
101
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_member_function_pointer,void const volatile,false)
 
102
#endif
 
103
 
 
104
} // namespace detail
 
105
 
 
106
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_function_pointer,T,::boost::detail::is_member_function_pointer_impl<T>::value)
 
107
 
 
108
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
109
 
 
110
} // namespace boost
 
111
 
 
112
#include "boost/type_traits/detail/bool_trait_undef.hpp"
 
113
 
 
114
#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED