1 
2 // (C) Copyright Tobias Schwinger
3 //
4 // Use modification and distribution are subject to the boost Software License,
5 // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
6 
7 //------------------------------------------------------------------------------
8 
9 #include <boost/mpl/assert.hpp>
10 #include <boost/function_types/is_member_function_pointer.hpp>
11 
12 namespace ft = boost::function_types;
13 
14 class C;
15 typedef void (C::*mem_func_ptr)();
16 typedef void (C::*c_mem_func_ptr)() const;
17 typedef void (C::*v_mem_func_ptr)() volatile;
18 typedef void (C::*cv_mem_func_ptr)() const volatile;
19 
20 
21 BOOST_MPL_ASSERT((
22   ft::is_member_function_pointer< mem_func_ptr, ft::non_const >
23 ));
24 
25 BOOST_MPL_ASSERT((
26   ft::is_member_function_pointer< mem_func_ptr, ft::non_volatile >
27 ));
28 
29 BOOST_MPL_ASSERT((
30   ft::is_member_function_pointer< mem_func_ptr,
31         ft::tag<ft::non_const, ft::non_volatile> >
32 ));
33 
34 BOOST_MPL_ASSERT_NOT((
35   ft::is_member_function_pointer< mem_func_ptr, ft::const_qualified >
36 ));
37 
38 BOOST_MPL_ASSERT_NOT((
39   ft::is_member_function_pointer< mem_func_ptr, ft::volatile_qualified >
40 ));
41 
42 BOOST_MPL_ASSERT_NOT((
43   ft::is_member_function_pointer< mem_func_ptr,
44         ft::tag<ft::const_qualified, ft::volatile_qualified> >
45 ));
46 
47 BOOST_MPL_ASSERT_NOT((
48   ft::is_member_function_pointer< mem_func_ptr,
49         ft::tag<ft::non_const, ft::volatile_qualified> >
50 ));
51 
52 BOOST_MPL_ASSERT_NOT((
53   ft::is_member_function_pointer< mem_func_ptr,
54         ft::tag<ft::const_qualified, ft::non_volatile> >
55 ));
56 
57 //
58 
59 BOOST_MPL_ASSERT((
60   ft::is_member_function_pointer< c_mem_func_ptr, ft::const_qualified >
61 ));
62 
63 BOOST_MPL_ASSERT((
64   ft::is_member_function_pointer< c_mem_func_ptr, ft::non_volatile >
65 ));
66 
67 BOOST_MPL_ASSERT_NOT((
68   ft::is_member_function_pointer< c_mem_func_ptr, ft::non_const >
69 ));
70 
71 BOOST_MPL_ASSERT_NOT((
72   ft::is_member_function_pointer< c_mem_func_ptr, ft::volatile_qualified >
73 ));
74 
75 BOOST_MPL_ASSERT((
76   ft::is_member_function_pointer< c_mem_func_ptr,
77         ft::tag<ft::const_qualified, ft::non_volatile> >
78 ));
79 
80 BOOST_MPL_ASSERT_NOT((
81   ft::is_member_function_pointer< c_mem_func_ptr,
82         ft::tag<ft::non_const, ft::volatile_qualified> >
83 ));
84 
85 //
86 
87 BOOST_MPL_ASSERT((
88   ft::is_member_function_pointer< v_mem_func_ptr, ft::volatile_qualified >
89 ));
90 
91 BOOST_MPL_ASSERT((
92   ft::is_member_function_pointer< v_mem_func_ptr, ft::non_const >
93 ));
94 
95 BOOST_MPL_ASSERT_NOT((
96   ft::is_member_function_pointer< v_mem_func_ptr, ft::non_volatile >
97 ));
98 
99 BOOST_MPL_ASSERT_NOT((
100   ft::is_member_function_pointer< v_mem_func_ptr, ft::const_qualified >
101 ));
102 
103 BOOST_MPL_ASSERT((
104   ft::is_member_function_pointer< v_mem_func_ptr,
105         ft::tag<ft::non_const, ft::volatile_qualified> >
106 ));
107 
108 BOOST_MPL_ASSERT_NOT((
109   ft::is_member_function_pointer< v_mem_func_ptr,
110         ft::tag<ft::const_qualified, ft::non_volatile> >
111 ));
112 
113 //
114 
115 BOOST_MPL_ASSERT((
116   ft::is_member_function_pointer< cv_mem_func_ptr, ft::const_qualified >
117 ));
118 
119 BOOST_MPL_ASSERT((
120   ft::is_member_function_pointer< cv_mem_func_ptr, ft::volatile_qualified >
121 ));
122 
123 BOOST_MPL_ASSERT_NOT((
124   ft::is_member_function_pointer< cv_mem_func_ptr, ft::non_const >
125 ));
126 
127 BOOST_MPL_ASSERT_NOT((
128   ft::is_member_function_pointer< cv_mem_func_ptr, ft::non_volatile >
129 ));
130 
131 BOOST_MPL_ASSERT_NOT((
132   ft::is_member_function_pointer< cv_mem_func_ptr,
133         ft::tag<ft::non_const, ft::non_volatile> >
134 ));
135 
136 BOOST_MPL_ASSERT_NOT((
137   ft::is_member_function_pointer< cv_mem_func_ptr,
138         ft::tag<ft::const_qualified, ft::non_volatile> >
139 ));
140 
141 BOOST_MPL_ASSERT_NOT((
142   ft::is_member_function_pointer< cv_mem_func_ptr,
143         ft::tag<ft::non_const, ft::volatile_qualified> >
144 ));
145 
146 BOOST_MPL_ASSERT((
147   ft::is_member_function_pointer< cv_mem_func_ptr,
148         ft::tag<ft::const_qualified, ft::volatile_qualified> >
149 ));
150 
151