]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function_types/test/classification/is_variadic.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / function_types / test / classification / is_variadic.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_callable_builtin.hpp>
11
12 namespace ft = boost::function_types;
13
14 typedef void func(...);
15 typedef void nv_func();
16 typedef void (*func_ptr)(...);
17 typedef void (*nv_func_ptr)();
18 typedef void (&func_ref)(...);
19 typedef void (&nv_func_ref)();
20 class C;
21 typedef void (C::*mem_func_ptr)(...);
22 typedef void (C::*nv_mem_func_ptr)();
23 typedef void (C::*c_mem_func_ptr)(...) const;
24 typedef void (C::*v_mem_func_ptr)(...) volatile;
25 typedef void (C::*cv_mem_func_ptr)(...) const volatile;
26 typedef int C::* mem_ptr;
27
28 BOOST_MPL_ASSERT((
29 ft::is_callable_builtin< func >
30 ));
31
32 BOOST_MPL_ASSERT((
33 ft::is_callable_builtin< func, ft::variadic >
34 ));
35
36 BOOST_MPL_ASSERT_NOT((
37 ft::is_callable_builtin< func, ft::non_variadic >
38 ));
39
40 BOOST_MPL_ASSERT((
41 ft::is_callable_builtin< nv_func >
42 ));
43
44 BOOST_MPL_ASSERT_NOT((
45 ft::is_callable_builtin< nv_func, ft::variadic >
46 ));
47
48 BOOST_MPL_ASSERT((
49 ft::is_callable_builtin< nv_func, ft::non_variadic >
50 ));
51
52 BOOST_MPL_ASSERT((
53 ft::is_callable_builtin< func_ptr >
54 ));
55
56 BOOST_MPL_ASSERT((
57 ft::is_callable_builtin< func_ptr, ft::variadic>
58 ));
59
60 BOOST_MPL_ASSERT_NOT((
61 ft::is_callable_builtin< func_ptr, ft::non_variadic >
62 ));
63
64 BOOST_MPL_ASSERT((
65 ft::is_callable_builtin< nv_func_ptr >
66 ));
67
68 BOOST_MPL_ASSERT_NOT((
69 ft::is_callable_builtin< nv_func_ptr, ft::variadic>
70 ));
71
72 BOOST_MPL_ASSERT((
73 ft::is_callable_builtin< nv_func_ptr, ft::non_variadic >
74 ));
75
76 BOOST_MPL_ASSERT((
77 ft::is_callable_builtin< func_ref >
78 ));
79
80 BOOST_MPL_ASSERT((
81 ft::is_callable_builtin< mem_func_ptr >
82 ));
83
84 BOOST_MPL_ASSERT((
85 ft::is_callable_builtin< mem_func_ptr, ft::variadic >
86 ));
87
88 BOOST_MPL_ASSERT_NOT((
89 ft::is_callable_builtin< mem_func_ptr, ft::non_variadic >
90 ));
91
92 BOOST_MPL_ASSERT((
93 ft::is_callable_builtin< nv_mem_func_ptr >
94 ));
95
96 BOOST_MPL_ASSERT_NOT((
97 ft::is_callable_builtin< nv_mem_func_ptr, ft::variadic >
98 ));
99
100 BOOST_MPL_ASSERT((
101 ft::is_callable_builtin< nv_mem_func_ptr, ft::non_variadic >
102 ));
103
104 BOOST_MPL_ASSERT((
105 ft::is_callable_builtin< c_mem_func_ptr >
106 ));
107
108 BOOST_MPL_ASSERT((
109 ft::is_callable_builtin< v_mem_func_ptr >
110 ));
111
112 BOOST_MPL_ASSERT((
113 ft::is_callable_builtin< cv_mem_func_ptr >
114 ));
115
116 BOOST_MPL_ASSERT_NOT((
117 ft::is_callable_builtin< func_ptr* >
118 ));
119
120 BOOST_MPL_ASSERT_NOT((
121 ft::is_callable_builtin< mem_func_ptr* >
122 ));
123
124 BOOST_MPL_ASSERT_NOT((
125 ft::is_callable_builtin< C, ft::variadic >
126 ));
127
128 BOOST_MPL_ASSERT_NOT((
129 ft::is_callable_builtin< C, ft::non_variadic >
130 ));
131
132 BOOST_MPL_ASSERT((
133 ft::is_callable_builtin< mem_ptr >
134 ));
135
136 BOOST_MPL_ASSERT_NOT((
137 ft::is_callable_builtin< mem_ptr, ft::variadic >
138 ));
139
140 BOOST_MPL_ASSERT((
141 ft::is_callable_builtin< mem_ptr, ft::non_variadic >
142 ));
143