]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/parameter/test/deduced_dependent_predicate.cpp
1 // Copyright Daniel Wallin 2006.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/parameter/config.hpp>
7 #include <boost/parameter/parameters.hpp>
8 #include <boost/parameter/name.hpp>
9 #include <boost/parameter/binding.hpp>
10 #include "deduced.hpp"
12 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
13 #include <boost/mp11/bind.hpp>
14 #include <boost/mp11/utility.hpp>
15 #include <type_traits>
17 #include <boost/mpl/bool.hpp>
18 #include <boost/mpl/placeholders.hpp>
19 #include <boost/mpl/if.hpp>
20 #include <boost/type_traits/is_same.hpp>
21 #include <boost/type_traits/is_convertible.hpp>
22 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
23 #include <boost/type_traits/remove_reference.hpp>
25 #include <boost/type_traits/add_lvalue_reference.hpp>
26 #endif // Borland workarounds needed
27 #endif // BOOST_PARAMETER_CAN_USE_MP11
31 BOOST_PARAMETER_NAME(x
)
32 BOOST_PARAMETER_NAME(y
)
33 BOOST_PARAMETER_NAME(z
)
36 #include <boost/core/lightweight_test.hpp>
41 boost::parameter::parameters
<
43 , boost::parameter::optional
<
44 boost::parameter::deduced
<test::tag::y
>
45 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
46 , boost::mp11::mp_bind
<
49 , boost::mp11::mp_bind
<
50 test::tag::x::binding_fn
54 #else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
57 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
59 , boost::remove_reference
<
60 boost::parameter::binding
<
66 boost::add_lvalue_reference
<boost::mpl::_1
>
67 , boost::parameter::binding
<boost::mpl::_2
,test::tag::x
>
68 #endif // Borland workarounds needed
73 #endif // BOOST_PARAMETER_CAN_USE_MP11
76 >((test::_x
= 0, test::_y
= 1), 0, 1);
79 boost::parameter::parameters
<
81 , boost::parameter::optional
<
82 boost::parameter::deduced
<test::tag::y
>
83 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
84 , boost::mp11::mp_bind
<
87 , boost::mp11::mp_bind
<
88 test::tag::x::binding_fn
92 #else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
95 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
97 , boost::remove_reference
<
98 boost::parameter::binding
<
104 boost::add_lvalue_reference
<boost::mpl::_1
>
105 , boost::parameter::binding
<boost::mpl::_2
,test::tag::x
>
106 #endif // Borland workarounds needed
111 #endif // BOOST_PARAMETER_CAN_USE_MP11
114 >((test::_x
= 0U, test::_y
= 1U), 0U, 1U);
117 boost::parameter::parameters
<
119 , boost::parameter::optional
<
120 boost::parameter::deduced
<test::tag::y
>
121 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
122 , boost::mp11::mp_bind
<
125 , boost::mp11::mp_bind_q
<test::tag::x
,boost::mp11::_2
>
129 boost::is_convertible
<boost::mpl::_1
,test::tag::x::_
>
136 >((test::_x
= 0, test::_y
= 1), 0, 1);
139 boost::parameter::parameters
<
141 , boost::parameter::optional
<
142 boost::parameter::deduced
<test::tag::y
>
143 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
144 , boost::mp11::mp_bind
<
147 , boost::mp11::mp_bind_q
<test::tag::x
,boost::mp11::_2
>
151 boost::is_convertible
<boost::mpl::_1
,test::tag::x::_1
>
158 >((test::_x
= 0U, test::_y
= 1U), 0U, 1U);
160 return boost::report_errors();