]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function_types/test/classification/is_function_pointer.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / function_types / test / classification / is_function_pointer.cpp
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_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
23
24 BOOST_MPL_ASSERT_NOT((
25 ft::is_function_pointer< func >
26 ));
27
28 BOOST_MPL_ASSERT((
29 ft::is_function_pointer< func_ptr >
30 ));
31
32 BOOST_MPL_ASSERT_NOT((
33 ft::is_function_pointer< func_ref >
34 ));
35
36 BOOST_MPL_ASSERT_NOT((
37 ft::is_function_pointer< mem_func_ptr >
38 ));
39
40 BOOST_MPL_ASSERT_NOT((
41 ft::is_function_pointer< c_mem_func_ptr >
42 ));
43
44 BOOST_MPL_ASSERT_NOT((
45 ft::is_function_pointer< v_mem_func_ptr >
46 ));
47
48 BOOST_MPL_ASSERT_NOT((
49 ft::is_function_pointer< cv_mem_func_ptr >
50 ));
51
52 BOOST_MPL_ASSERT_NOT((
53 ft::is_function_pointer< func_ptr* >
54 ));
55
56 BOOST_MPL_ASSERT_NOT((
57 ft::is_function_pointer< mem_func_ptr* >
58 ));
59
60 BOOST_MPL_ASSERT_NOT((
61 ft::is_function_pointer< C >
62 ));
63
64 BOOST_MPL_ASSERT_NOT((
65 ft::is_function_pointer< int >
66 ));
67
68 BOOST_MPL_ASSERT_NOT((
69 ft::is_function_pointer< int* >
70 ));
71
72 BOOST_MPL_ASSERT_NOT((
73 ft::is_function_pointer< int** >
74 ));
75
76 BOOST_MPL_ASSERT_NOT((
77 ft::is_function_pointer< int& >
78 ));
79
80 BOOST_MPL_ASSERT_NOT((
81 ft::is_function_pointer< int[] >
82 ));
83
84 BOOST_MPL_ASSERT_NOT((
85 ft::is_function_pointer< int[1] >
86 ));
87