]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function_types/test/synthesis/member_function_pointer.cpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / function_types / test / synthesis / member_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/mpl/vector.hpp>
11 #include <boost/type_traits/is_same.hpp>
12 #include <boost/function_types/member_function_pointer.hpp>
13
14 namespace ft = boost::function_types;
15 namespace mpl = boost::mpl;
16 using boost::is_same;
17
18 class C;
19
20 typedef int (C::* expected1)(int);
21 typedef int (C::* expected2)(int) const;
22 typedef int (C::* expected3)(int) volatile;
23 typedef int (C::* expected4)(int) const volatile;
24
25
26 BOOST_MPL_ASSERT((
27 is_same< ft::member_function_pointer< mpl::vector<int,C,int> >::type
28 , expected1 >
29 ));
30
31 BOOST_MPL_ASSERT((
32 is_same< ft::member_function_pointer< mpl::vector<int,C,int>,
33 ft::tag<ft::non_const, ft::non_volatile> >::type
34 , expected1 >
35 ));
36
37 BOOST_MPL_ASSERT((
38 is_same< ft::member_function_pointer< mpl::vector<int,C,int>
39 , ft::const_qualified >::type
40 , expected2 >
41 ));
42
43 BOOST_MPL_ASSERT((
44 is_same< ft::member_function_pointer< mpl::vector<int,C,int>,
45 ft::tag<ft::const_qualified, ft::non_volatile> >::type
46 , expected2 >
47 ));
48
49 BOOST_MPL_ASSERT((
50 is_same< ft::member_function_pointer< mpl::vector<int,C,int>
51 , ft::volatile_qualified >::type
52 , expected3 >
53 ));
54
55 BOOST_MPL_ASSERT((
56 is_same< ft::member_function_pointer< mpl::vector<int,C,int>,
57 ft::tag<ft::non_const, ft::volatile_qualified> >::type
58 , expected3 >
59 ));
60
61 BOOST_MPL_ASSERT((
62 is_same< ft::member_function_pointer< mpl::vector<int,C,int>,
63 ft::tag<ft::const_qualified, ft::volatile_qualified> >::type
64 , expected4 >
65 ));
66