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 typedef void func();
15 typedef void (*func_ptr)();
16 typedef void (&func_ref)();
17 class C;
18 typedef void (C::*mem_func_ptr)();
19 typedef void (C::*c_mem_func_ptr)() const;
20 typedef void (C::*v_mem_func_ptr)() volatile;
21 typedef void (C::*cv_mem_func_ptr)() const volatile;
22 typedef int C::*mem_ptr;
23 
24 
25 BOOST_MPL_ASSERT_NOT((
26   ft::is_member_function_pointer< func >
27 ));
28 
29 BOOST_MPL_ASSERT_NOT((
30   ft::is_member_function_pointer< func_ptr >
31 ));
32 
33 BOOST_MPL_ASSERT_NOT((
34   ft::is_member_function_pointer< func_ref >
35 ));
36 
37 BOOST_MPL_ASSERT((
38   ft::is_member_function_pointer< mem_func_ptr >
39 ));
40 
41 BOOST_MPL_ASSERT((
42   ft::is_member_function_pointer< c_mem_func_ptr >
43 ));
44 
45 BOOST_MPL_ASSERT((
46   ft::is_member_function_pointer< v_mem_func_ptr >
47 ));
48 
49 BOOST_MPL_ASSERT((
50   ft::is_member_function_pointer< cv_mem_func_ptr >
51 ));
52 
53 BOOST_MPL_ASSERT_NOT((
54   ft::is_member_function_pointer< mem_ptr >
55 ));
56 
57 BOOST_MPL_ASSERT_NOT((
58   ft::is_member_function_pointer< func_ptr* >
59 ));
60 
61 BOOST_MPL_ASSERT_NOT((
62   ft::is_member_function_pointer< mem_func_ptr* >
63 ));
64 
65 BOOST_MPL_ASSERT_NOT((
66   ft::is_member_function_pointer< mem_ptr* >
67 ));
68 
69 BOOST_MPL_ASSERT_NOT((
70   ft::is_member_function_pointer< C >
71 ));
72 
73 BOOST_MPL_ASSERT_NOT((
74   ft::is_member_function_pointer< int >
75 ));
76 
77 BOOST_MPL_ASSERT_NOT((
78   ft::is_member_function_pointer< int* >
79 ));
80 
81 BOOST_MPL_ASSERT_NOT((
82   ft::is_member_function_pointer< int** >
83 ));
84 
85 BOOST_MPL_ASSERT_NOT((
86   ft::is_member_function_pointer< int& >
87 ));
88 
89 BOOST_MPL_ASSERT_NOT((
90   ft::is_member_function_pointer< int[] >
91 ));
92 
93 BOOST_MPL_ASSERT_NOT((
94   ft::is_member_function_pointer< int[1] >
95 ));
96 
97