]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/callable_traits/example/remove_member_const.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / callable_traits / example / remove_member_const.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 <boost/callable_traits/detail/config.hpp>
8 #ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
9 int main(){ return 0; }
10 #else
11
12 //[ remove_member_const
13 #include <type_traits>
14 #include <boost/callable_traits/remove_member_const.hpp>
15
16 namespace ct = boost::callable_traits;
17
18 struct foo {};
19
20 int main() {
21
22 {
23 using pmf = int(foo::*)() const;
24 using expect = int(foo::*)();
25 using test = ct::remove_member_const_t<pmf>;
26 static_assert(std::is_same<test, expect>::value, "");
27 } {
28 using pmf = int(foo::*)() const &&;
29 using expect = int(foo::*)() &&;
30 using test = ct::remove_member_const_t<pmf>;
31 static_assert(std::is_same<test, expect>::value, "");
32 } {
33 using pmf = int(foo::*)() const volatile &;
34 using expect = int(foo::*)() volatile &;
35 using test = ct::remove_member_const_t<pmf>;
36 static_assert(std::is_same<test, expect>::value, "");
37 } {
38 using f = int() const;
39 using expect = int();
40 using test = ct::remove_member_const_t<f>;
41 static_assert(std::is_same<test, expect>::value, "");
42 }
43 }
44 //]
45 #endif //#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS