]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/function_types/test/classification/is_cv_function.cpp
2 // (C) Copyright Tobias Schwinger
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).
7 //------------------------------------------------------------------------------
9 #include <boost/mpl/assert.hpp>
10 #include <boost/function_types/is_function.hpp>
12 namespace ft
= boost::function_types
;
14 template<typename C
, typename T
>
15 void test_non_cv(T
C::*)
18 ft::is_function
<T
, ft::non_const
>
22 ft::is_function
<T
, ft::non_volatile
>
26 ft::is_function
<T
, ft::tag
<ft::non_const
,ft::non_volatile
> >
29 BOOST_MPL_ASSERT_NOT((
30 ft::is_function
<T
, ft::const_qualified
>
33 BOOST_MPL_ASSERT_NOT((
34 ft::is_function
<T
, ft::volatile_qualified
>
37 BOOST_MPL_ASSERT_NOT((
38 ft::is_function
<T
, ft::tag
<ft::const_qualified
,ft::volatile_qualified
> >
42 template<typename C
, typename T
>
43 void test_c_non_v(T
C::*)
46 ft::is_function
<T
, ft::const_qualified
>
50 ft::is_function
<T
, ft::non_volatile
>
54 ft::is_function
<T
, ft::tag
<ft::const_qualified
,ft::non_volatile
> >
57 BOOST_MPL_ASSERT_NOT((
58 ft::is_function
<T
, ft::non_const
>
61 BOOST_MPL_ASSERT_NOT((
62 ft::is_function
<T
, ft::volatile_qualified
>
65 BOOST_MPL_ASSERT_NOT((
66 ft::is_function
<T
, ft::tag
<ft::non_const
,ft::volatile_qualified
> >
70 template<typename C
, typename T
>
71 void test_v_non_c(T
C::*)
74 ft::is_function
<T
, ft::non_const
>
78 ft::is_function
<T
, ft::volatile_qualified
>
82 ft::is_function
<T
, ft::tag
<ft::non_const
,ft::volatile_qualified
> >
85 BOOST_MPL_ASSERT_NOT((
86 ft::is_function
<T
, ft::const_qualified
>
89 BOOST_MPL_ASSERT_NOT((
90 ft::is_function
<T
, ft::non_volatile
>
93 BOOST_MPL_ASSERT_NOT((
94 ft::is_function
<T
, ft::tag
<ft::const_qualified
,ft::non_volatile
> >
98 template<typename C
, typename T
>
102 ft::is_function
<T
, ft::const_qualified
>
106 ft::is_function
<T
, ft::volatile_qualified
>
110 ft::is_function
<T
, ft::tag
<ft::const_qualified
,ft::volatile_qualified
> >
113 BOOST_MPL_ASSERT_NOT((
114 ft::is_function
<T
, ft::non_const
>
117 BOOST_MPL_ASSERT_NOT((
118 ft::is_function
<T
, ft::non_volatile
>
121 BOOST_MPL_ASSERT_NOT((
122 ft::is_function
<T
, ft::tag
<ft::non_const
,ft::non_volatile
> >
130 void c_non_v(int) const { }
131 void v_non_c(int) volatile { }
132 void cv(int) const volatile { }
137 test_non_cv(& C::non_cv
);
138 test_c_non_v(& C::c_non_v
);
139 test_v_non_c(& C::v_non_c
);