1 // Copyright David Abrahams, Daniel Wallin 2005.
2 // Copyright Cromwell D. Enage 2017.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_PARAMETER_TEST_BASICS_HPP
8 #define BOOST_PARAMETER_TEST_BASICS_HPP
10 #include <boost/parameter.hpp>
12 #if (BOOST_PARAMETER_MAX_ARITY < 4)
13 #error Define BOOST_PARAMETER_MAX_ARITY as 4 or greater.
15 #if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) && \
16 (BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY < 5)
17 #error Define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY \
21 #if !defined(BOOST_PARAMETER_CAN_USE_MP11)
22 #include <boost/mpl/bool.hpp>
23 #include <boost/mpl/if.hpp>
24 #include <boost/mpl/assert.hpp>
25 #include <boost/type_traits/is_same.hpp>
28 #include <boost/core/lightweight_test.hpp>
32 BOOST_PARAMETER_NAME(name)
33 BOOST_PARAMETER_NAME(value)
34 BOOST_PARAMETER_NAME(index)
35 BOOST_PARAMETER_NAME(tester)
37 struct f_parameters // vc6 is happier with inheritance than with a typedef
38 : boost::parameter::parameters<
47 inline double value_default()
53 inline bool equal(T const& x, T const& y)
58 template <typename Name, typename Value, typename Index>
61 values_t(Name const& n_, Value const& v_, Index const& i_)
66 template <typename Name_, typename Value_, typename Index_>
74 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
76 std::is_same<Index,Index_>::value
80 std::is_same<Value,Value_>::value
84 std::is_same<Name,Name_>::value
87 #else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
89 typename boost::mpl::if_<
90 boost::is_same<Index,Index_>
96 typename boost::mpl::if_<
97 boost::is_same<Value,Value_>
103 typename boost::mpl::if_<
104 boost::is_same<Name,Name_>
109 #endif // BOOST_PARAMETER_CAN_USE_MP11
110 BOOST_TEST(test::equal(n, n_));
111 BOOST_TEST(test::equal(v, v_));
112 BOOST_TEST(test::equal(i, i_));
120 template <typename Name, typename Value, typename Index>
121 inline test::values_t<Name,Value,Index>
122 values(Name const& n, Value const& v, Index const& i)
124 return test::values_t<Name,Value,Index>(n, v, i);
128 #endif // include guard