]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/parameter/test/ntp.cpp
1 // Copyright Daniel Wallin 2006. Use, modification and distribution is
2 // subject to the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 #include <boost/parameter.hpp>
6 #include <boost/mpl/assert.hpp>
7 #include <boost/type_traits/is_same.hpp>
8 #include <boost/type_traits/is_base_and_derived.hpp>
10 namespace mpl
= boost::mpl
;
11 namespace parameter
= boost::parameter
;
13 template <class T
= int>
15 : parameter::template_keyword
<a0_is
<>, T
>
18 template <class T
= int>
20 : parameter::template_keyword
<a1_is
<>, T
>
23 template <class T
= int>
25 : parameter::template_keyword
<a2_is
<>, T
>
28 template <class T
= int>
30 : parameter::template_keyword
<a3_is
<>, T
>
37 class A0
= parameter::void_
38 , class A1
= parameter::void_
39 , class A2
= parameter::void_
40 , class A3
= parameter::void_
44 typedef typename
parameter::parameters
<
45 a0_is
<>, a1_is
<>, a2_is
<>
46 , parameter::optional
<
47 parameter::deduced
<a3_is
<> >
48 , boost::is_base_and_derived
<X
, mpl::_
>
51 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
56 typedef typename
parameter::binding
<
60 typedef typename
parameter::binding
<
64 typedef typename
parameter::binding
<
68 typedef typename
parameter::binding
<
72 typedef void(*type
)(a0
,a1
,a2
,a3
);
75 BOOST_MPL_ASSERT((boost::is_same
<
76 with_ntp
<>::type
, void(*)(void*,void*,void*,void*)
79 BOOST_MPL_ASSERT((boost::is_same
<
80 with_ntp
<a2_is
<int> >::type
, void(*)(void*,void*,int,void*)
83 BOOST_MPL_ASSERT((boost::is_same
<
84 with_ntp
<a1_is
<int> >::type
, void(*)(void*,int,void*,void*)
87 BOOST_MPL_ASSERT((boost::is_same
<
88 with_ntp
<a2_is
<int const>, a1_is
<float> >::type
, void(*)(void*,float,int const,void*)
91 BOOST_MPL_ASSERT((boost::is_same
<
92 with_ntp
<int const>::type
, void(*)(int const, void*, void*,void*)
95 BOOST_MPL_ASSERT((boost::is_same
<
96 with_ntp
<int, float>::type
, void(*)(int, float, void*,void*)
99 BOOST_MPL_ASSERT((boost::is_same
<
100 with_ntp
<int, float, char>::type
, void(*)(int, float, char,void*)
103 BOOST_MPL_ASSERT((boost::is_same
<
104 with_ntp
<a0_is
<int>, Y
>::type
, void(*)(int,void*,void*, Y
)
107 BOOST_MPL_ASSERT((boost::is_same
<
108 with_ntp
<int&, a2_is
<char>, Y
>::type
, void(*)(int&,void*,char, Y
)