1 // Copyright Cromwell D. Enage 2017.
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>
9 !defined(__MINGW32__) && \
10 defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) \
11 ) || defined(BOOST_MSVC)
12 #if (BOOST_PARAMETER_MAX_ARITY < 8)
13 #error Define BOOST_PARAMETER_MAX_ARITY as 8 or greater.
15 #else // mingw, or no perfect forwarding support and not msvc
16 #if (BOOST_PARAMETER_COMPOSE_MAX_ARITY < 8)
17 #error Define BOOST_PARAMETER_COMPOSE_MAX_ARITY as 8 or greater.
19 #endif // msvc, or perfect forwarding support and not mingw
21 #include <boost/parameter/name.hpp>
25 BOOST_PARAMETER_NAME((_lrc0
, kw
) in(lrc0
))
26 BOOST_PARAMETER_NAME((_lr0
, kw
) in_out(lr0
))
27 BOOST_PARAMETER_NAME((_rrc0
, kw
) in(rrc0
))
28 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
29 BOOST_PARAMETER_NAME((_rr0
, kw
) consume(rr0
))
31 BOOST_PARAMETER_NAME((_rr0
, kw
) rr0
)
33 BOOST_PARAMETER_NAME((_lrc1
, kw
) in(lrc1
))
34 BOOST_PARAMETER_NAME((_lr1
, kw
) out(lr1
))
35 BOOST_PARAMETER_NAME((_rrc1
, kw
) in(rrc1
))
36 BOOST_PARAMETER_NAME((_rr1
, kw
) rr1
)
39 #include <boost/mpl/bool.hpp>
40 #include <boost/mpl/placeholders.hpp>
41 #include <boost/mpl/if.hpp>
42 #include <boost/core/lightweight_test.hpp>
43 #include <boost/type_traits/is_convertible.hpp>
44 #include "evaluate_category.hpp"
46 #if !defined(__MINGW32__) && defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
47 #include <boost/parameter/preprocessor.hpp>
49 #elif defined(BOOST_MSVC)
50 #include <boost/parameter/preprocessor.hpp>
52 #include <boost/parameter/preprocessor_no_spec.hpp>
60 !defined(__MINGW32__) && \
61 defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) \
62 ) || defined(BOOST_MSVC)
63 typedef boost::mpl::if_
<
64 boost::is_convertible
<boost::mpl::_
,std::bitset
<1> >
68 typedef boost::mpl::if_
<
69 boost::is_convertible
<boost::mpl::_
,std::bitset
<2> >
73 typedef boost::mpl::if_
<
74 boost::is_convertible
<boost::mpl::_
,std::bitset
<3> >
78 typedef boost::mpl::if_
<
79 boost::is_convertible
<boost::mpl::_
,std::bitset
<4> >
83 typedef boost::mpl::if_
<
84 boost::is_convertible
<boost::mpl::_
,std::bitset
<5> >
88 typedef boost::mpl::if_
<
89 boost::is_convertible
<boost::mpl::_
,std::bitset
<6> >
93 typedef boost::mpl::if_
<
94 boost::is_convertible
<boost::mpl::_
,std::bitset
<7> >
98 typedef boost::mpl::if_
<
99 boost::is_convertible
<boost::mpl::_
,std::bitset
<8> >
104 BOOST_PARAMETER_CONST_FUNCTION_CALL_OPERATOR((bool), kw
,
114 (lr1
, *(bs5_pred
), test::lvalue_bitset
<5>())
115 (rrc1
, *(bs6_pred
), test::rvalue_const_bitset
<6>())
116 (rr1
, *(bs7_pred
), test::rvalue_bitset
<7>())
121 BOOST_PARAMETER_NO_SPEC_CONST_FUNCTION_CALL_OPERATOR((bool))
122 #endif // msvc, or perfect forwarding support and not mingw
125 !defined(__MINGW32__) && \
126 defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) \
127 ) || defined(BOOST_MSVC)
129 test::passed_by_lvalue_reference_to_const
130 , test::U::evaluate_category
<0>(lrc0
)
133 test::passed_by_lvalue_reference
134 , test::U::evaluate_category
<1>(lr0
)
137 test::passed_by_lvalue_reference_to_const
138 , test::U::evaluate_category
<4>(lrc1
)
141 test::passed_by_lvalue_reference
142 , test::U::evaluate_category
<5>(lr1
)
144 #else // mingw, or no perfect forwarding support and not msvc
146 test::passed_by_lvalue_reference_to_const
147 , test::U::evaluate_category
<0>(args
[test::_lrc0
])
150 test::passed_by_lvalue_reference
151 , test::U::evaluate_category
<1>(args
[test::_lr0
])
154 test::passed_by_lvalue_reference_to_const
155 , test::U::evaluate_category
<4>(args
[test::_lrc1
])
158 test::passed_by_lvalue_reference
159 , test::U::evaluate_category
<5>(
160 args
[test::_lr1
| test::lvalue_bitset
<5>()]
163 #endif // msvc, or perfect forwarding support and not mingw
164 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
165 #if defined(__MINGW32__)
167 test::passed_by_rvalue_reference_to_const
168 , test::U::evaluate_category
<2>(args
[test::_rrc0
])
171 test::passed_by_rvalue_reference
172 , test::U::evaluate_category
<3>(args
[test::_rr0
])
175 test::passed_by_rvalue_reference_to_const
176 , test::U::evaluate_category
<6>(
177 args
[test::_rrc1
| test::rvalue_const_bitset
<6>()]
181 test::passed_by_rvalue_reference
182 , test::U::evaluate_category
<7>(
183 args
[test::_rr1
| test::rvalue_bitset
<7>()]
186 #else // !defined(__MINGW32__)
188 test::passed_by_rvalue_reference_to_const
189 , test::U::evaluate_category
<2>(std::forward
<rrc0_type
>(rrc0
))
192 test::passed_by_rvalue_reference
193 , test::U::evaluate_category
<3>(std::forward
<rr0_type
>(rr0
))
196 test::passed_by_rvalue_reference_to_const
197 , test::U::evaluate_category
<6>(std::forward
<rrc1_type
>(rrc1
))
200 test::passed_by_rvalue_reference
201 , test::U::evaluate_category
<7>(std::forward
<rr1_type
>(rr1
))
203 #endif // __MINGW32__
204 #else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
205 #if defined(BOOST_MSVC)
207 test::passed_by_lvalue_reference_to_const
208 , test::U::evaluate_category
<2>(rrc0
)
211 test::passed_by_lvalue_reference_to_const
212 , test::U::evaluate_category
<3>(rr0
)
215 test::passed_by_lvalue_reference_to_const
216 , test::U::evaluate_category
<6>(rrc1
)
219 test::passed_by_lvalue_reference_to_const
220 , test::U::evaluate_category
<7>(rr1
)
222 #else // !defined(BOOST_MSVC)
224 test::passed_by_lvalue_reference_to_const
225 , test::U::evaluate_category
<2>(args
[test::_rrc0
])
228 test::passed_by_lvalue_reference_to_const
229 , test::U::evaluate_category
<3>(args
[test::_rr0
])
232 test::passed_by_lvalue_reference_to_const
233 , test::U::evaluate_category
<6>(
234 args
[test::_rrc1
| test::rvalue_const_bitset
<6>()]
238 test::passed_by_lvalue_reference_to_const
239 , test::U::evaluate_category
<7>(
240 args
[test::_rr1
| test::rvalue_bitset
<7>()]
244 #endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
257 !defined(__MINGW32__) && \
258 defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) \
259 ) || defined(BOOST_MSVC)
261 test::lvalue_const_bitset
<4>()
262 , test::lvalue_const_bitset
<0>()
263 , test::lvalue_bitset
<1>()
264 , test::rvalue_const_bitset
<2>()
265 , test::rvalue_bitset
<3>()
268 test::lvalue_const_bitset
<4>()
269 , test::lvalue_const_bitset
<0>()
270 , test::rvalue_const_bitset
<6>()
271 , test::lvalue_bitset
<1>()
272 , test::rvalue_const_bitset
<2>()
273 , test::rvalue_bitset
<3>()
276 test::lvalue_bitset
<1>()
277 , test::rvalue_const_bitset
<2>()
278 , test::rvalue_bitset
<3>()
279 , test::lvalue_const_bitset
<4>()
280 , test::lvalue_bitset
<5>()
281 , test::rvalue_const_bitset
<6>()
282 , test::rvalue_bitset
<7>()
283 , test::lvalue_const_bitset
<0>()
285 #else // mingw, or no perfect forwarding support and not msvc
287 test::_lrc1
= test::lvalue_const_bitset
<4>()
288 , test::_lrc0
= test::lvalue_const_bitset
<0>()
289 , test::_lr0
= test::lvalue_bitset
<1>()
290 , test::_rrc0
= test::rvalue_const_bitset
<2>()
291 , test::_rr0
= test::rvalue_bitset
<3>()
294 test::_lrc1
= test::lvalue_const_bitset
<4>()
295 , test::_lrc0
= test::lvalue_const_bitset
<0>()
296 , test::_rrc1
= test::rvalue_const_bitset
<6>()
297 , test::_lr0
= test::lvalue_bitset
<1>()
298 , test::_rrc0
= test::rvalue_const_bitset
<2>()
299 , test::_rr0
= test::rvalue_bitset
<3>()
302 test::_lr0
= test::lvalue_bitset
<1>()
303 , test::_rrc0
= test::rvalue_const_bitset
<2>()
304 , test::_rr0
= test::rvalue_bitset
<3>()
305 , test::_lrc1
= test::lvalue_const_bitset
<4>()
306 , test::_lr1
= test::lvalue_bitset
<5>()
307 , test::_rrc1
= test::rvalue_const_bitset
<6>()
308 , test::_rr1
= test::rvalue_bitset
<7>()
309 , test::_lrc0
= test::lvalue_const_bitset
<0>()
311 #endif // msvc, or perfect forwarding support and not mingw
312 return boost::report_errors();