]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/callable_traits/test/remove_member_volatile.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / callable_traits / test / remove_member_volatile.cpp
1 /*
2 Copyright Barrett Adair 2016-2017
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE.md or copy at http ://boost.org/LICENSE_1_0.txt)
5 */
6
7 #include <type_traits>
8 #include <functional>
9 #include <tuple>
10 #include <boost/callable_traits/remove_member_volatile.hpp>
11 #include "test.hpp"
12
13 struct foo{};
14
15 int main() {
16
17 {
18 using f = char(foo::*)(foo*, int);
19 using l = char(foo::*)(foo*, int) LREF;
20 using r = char(foo::*)(foo*, int) RREF;
21 using c = char(foo::*)(foo*, int) const;
22 using cl = char(foo::*)(foo*, int) const LREF;
23 using cr = char(foo::*)(foo*, int) const RREF;
24 using v = char(foo::*)(foo*, int) volatile;
25 using vl = char(foo::*)(foo*, int) volatile LREF;
26 using vr = char(foo::*)(foo*, int) volatile RREF;
27 using cv = char(foo::*)(foo*, int) const volatile;
28 using cvl = char(foo::*)(foo*, int) const volatile LREF;
29 using cvr = char(foo::*)(foo*, int) const volatile RREF;
30
31 CT_ASSERT(std::is_same<f, TRAIT(remove_member_volatile, f)>{});
32 CT_ASSERT(std::is_same<l, TRAIT(remove_member_volatile, vl)>{});
33 CT_ASSERT(std::is_same<l, TRAIT(remove_member_volatile, l)>{});
34 CT_ASSERT(std::is_same<f, TRAIT(remove_member_volatile, v)>{});
35 CT_ASSERT(std::is_same<r, TRAIT(remove_member_volatile, r)>{});
36 CT_ASSERT(std::is_same<r, TRAIT(remove_member_volatile, vr)>{});
37 CT_ASSERT(std::is_same<c, TRAIT(remove_member_volatile, c)>{});
38 CT_ASSERT(std::is_same<c, TRAIT(remove_member_volatile, cv)>{});
39 CT_ASSERT(std::is_same<cl, TRAIT(remove_member_volatile, cl)>{});
40 CT_ASSERT(std::is_same<cl, TRAIT(remove_member_volatile, cvl)>{});
41 CT_ASSERT(std::is_same<cr, TRAIT(remove_member_volatile, cr)>{});
42 CT_ASSERT(std::is_same<cr, TRAIT(remove_member_volatile, cvr)>{});
43 }
44
45 #ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
46
47 {
48 using f = foo&&();
49 using l = foo&&() LREF;
50 using r = foo&&() RREF;
51 using c = foo&&() const;
52 using cl = foo&&() const LREF;
53 using cr = foo&&() const RREF;
54 using v = foo&&() volatile;
55 using vl = foo&&() volatile LREF;
56 using vr = foo&&() volatile RREF;
57 using cv = foo&&() const volatile;
58 using cvl = foo&&() const volatile LREF;
59 using cvr = foo&&() const volatile RREF;
60
61 CT_ASSERT(std::is_same<f, TRAIT(remove_member_volatile, f)>{});
62 CT_ASSERT(std::is_same<f, TRAIT(remove_member_volatile, v)>{});
63 CT_ASSERT(std::is_same<l, TRAIT(remove_member_volatile, vl)>{});
64 CT_ASSERT(std::is_same<l, TRAIT(remove_member_volatile, l)>{});
65 CT_ASSERT(std::is_same<r, TRAIT(remove_member_volatile, r)>{});
66 CT_ASSERT(std::is_same<r, TRAIT(remove_member_volatile, vr)>{});
67 CT_ASSERT(std::is_same<c, TRAIT(remove_member_volatile, c)>{});
68 CT_ASSERT(std::is_same<c, TRAIT(remove_member_volatile, cv)>{});
69 CT_ASSERT(std::is_same<cl, TRAIT(remove_member_volatile, cl)>{});
70 CT_ASSERT(std::is_same<cl, TRAIT(remove_member_volatile, cvl)>{});
71 CT_ASSERT(std::is_same<cr, TRAIT(remove_member_volatile, cr)>{});
72 CT_ASSERT(std::is_same<cr, TRAIT(remove_member_volatile, cvr)>{});
73 }
74
75 #endif //#ifndef BOOST_CLBL_TRTS_DISABLE_ABOMINABLE_FUNCTIONS
76
77 }