]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/callable_traits/example/add_member_volatile.cpp
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)
7 #include <boost/callable_traits/detail/config.hpp>
8 #ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS
9 int main(){ return 0; }
12 //[ add_member_volatile
13 #include <type_traits>
14 #include <boost/callable_traits/add_member_volatile.hpp>
16 namespace ct
= boost::callable_traits
;
23 using pmf
= void(foo::*)();
24 using expect
= void(foo::*)() volatile;
25 using test
= ct::add_member_volatile_t
<pmf
>;
26 static_assert(std::is_same
<test
, expect
>::value
, "");
28 // add_member_volatile_t doesn't change anything when
29 // the function type is already volatile.
30 using pmf
= void(foo::*)() volatile &&;
31 using expect
= void(foo::*)() volatile &&;
32 using test
= ct::add_member_volatile_t
<pmf
>;
33 static_assert(std::is_same
<test
, expect
>::value
, "");
35 using pmf
= void(foo::*)() const &;
36 using expect
= void(foo::*)() const volatile &;
37 using test
= ct::add_member_volatile_t
<pmf
>;
38 static_assert(std::is_same
<test
, expect
>::value
, "");
40 // add_member_volatile_t can also be used with "abominable"
43 using expect
= void() volatile;
44 using test
= ct::add_member_volatile_t
<f
>;
45 static_assert(std::is_same
<test
, expect
>::value
, "");
50 #endif //#ifdef BOOST_CLBL_TRTS_DISABLE_REFERENCE_QUALIFIERS