mirror of
https://github.com/boostorg/parameter.git
synced 2026-01-28 19:32:11 +00:00
<boost/parameter/parameters.hpp>: * Add preprocessor conditional statement to prevent generation of ill-formed function call operator overloads. "test/maybe.cpp" "test/singular.cpp" "test/tutorial.cpp" "test/sfinae.cpp" "test/earwicker.cpp" * Replace BOOST_PARAMETER_KEYWORD statements with BOOST_PARAMETER_NAME statements. "test/optional_deduced_sfinae.cpp" "test/normalized_argument_types.cpp" "test/literate/*.cpp" * Use Boost.Core.LightweightTest where int main() is available. * Replace assert statements with BOOST_TEST_EQ statements. "test/basics.hpp" * Remove preprocessor statements regarding borland, gcc-2, and msvc workarounds. "test/ntp.cpp" "test/sfinae.cpp" "test/earwicker.cpp" "test/normalized_argument_types.cpp" "test/basics.hpp" * Add preprocessor conditional statement to #error out if BOOST_PARAMETER_MAX_ARITY is set to an insufficient value. "test/basics.cpp" "test/deduced.cpp" "test/macros.cpp" "test/preprocessor.cpp" "test/preprocessor_deduced.cpp" * Replace S and char const* expressions with boost::container::string expressions. * Uncomment any code that fails to compile, but add preprocessor conditional statement so that test suites can incorporate compile-fail statements regarding the code in question. * Ensure that int main() returns boost::process_errors(). "test/literate/deduced-template-parameters0.cpp": "test/literate/exercising-the-code-so-far0.cpp": * Enclose BOOST_MPL_ASSERT statements within MPL_TEST_CASE block. "test/literate/defining-the-keywords1.cpp": * Add graphs::tag::graph::qualifier type definition because perfect forwarding code will check for it. * Replace deprecated keyword::get() invocation with keyword::instance invocation. test/Jamfile.v2: * Add modifier <define>BOOST_PARAMETER_MAX_ARITY=# to run, run-fail, compile, and compile-fail statements to conserve compiler memory usage on GitHub's side. * Add modifier <preserve-target-tests>off to run and run-fail statements to conserve executable space on GitHub's side. * Separate bpl-test statement into its own target, parameter_python_test, which fails on xcode8.3 as well as on mingw and msvc compilers with address-model=64. * The next commit (which will implement perfect forwarding) will subsume test/literate/Jamfile.v2 into this file. Strangely enough, attempting to do so now will result in compiler errors. .travis.yml: * Add g++-4.7, g++-4.8, g++-4.9, clang++-3.5, clang++-3.6, clang++-3.7, clang++-3.8, clang++-3.9, clang++-4.0, xcode7.3, and xcode8.3 compiler configurations. * Split compiler configurations by available CXXSTD values. (This will keep the job times within limits for the next commit.) * Ensure that the xcode8.3 compiler configurations exclude parameter_python_test from the test suite. appveyor.yml: * Add compiler configurations that support address-model=64 to the test matrix. * Ensure that the new configurations exclude parameter_python_test from the test suite.
118 lines
3.9 KiB
C++
118 lines
3.9 KiB
C++
// Copyright Daniel Wallin 2006.
|
|
// Distributed under the Boost Software License, Version 1.0.
|
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
|
// http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#include <boost/parameter/config.hpp>
|
|
#include <boost/parameter/parameters.hpp>
|
|
#include <boost/parameter/name.hpp>
|
|
#include <boost/parameter/binding.hpp>
|
|
#include <boost/mpl/bool.hpp>
|
|
#include <boost/mpl/placeholders.hpp>
|
|
#include <boost/mpl/if.hpp>
|
|
#include <boost/type_traits/is_same.hpp>
|
|
#include <boost/type_traits/is_convertible.hpp>
|
|
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
#include <boost/type_traits/remove_reference.hpp>
|
|
#else
|
|
#include <boost/type_traits/add_lvalue_reference.hpp>
|
|
#endif // Borland workarounds needed.
|
|
#include "deduced.hpp"
|
|
|
|
namespace test {
|
|
|
|
BOOST_PARAMETER_NAME(x)
|
|
BOOST_PARAMETER_NAME(y)
|
|
BOOST_PARAMETER_NAME(z)
|
|
} // namespace test
|
|
|
|
#include <boost/core/lightweight_test.hpp>
|
|
|
|
int main()
|
|
{
|
|
test::check<
|
|
boost::parameter::parameters<
|
|
test::tag::x
|
|
, boost::parameter::optional<
|
|
boost::parameter::deduced<test::tag::y>
|
|
, boost::mpl::if_<
|
|
boost::is_same<
|
|
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
boost::mpl::_1
|
|
, boost::remove_reference<
|
|
boost::parameter::binding<
|
|
boost::mpl::_2
|
|
, test::tag::x
|
|
>
|
|
>
|
|
#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
boost::add_lvalue_reference<boost::mpl::_1>
|
|
, boost::parameter::binding<boost::mpl::_2,test::tag::x>
|
|
#endif // Borland workarounds needed.
|
|
>
|
|
, boost::mpl::true_
|
|
, boost::mpl::false_
|
|
>
|
|
>
|
|
>
|
|
>((test::_x = 0, test::_y = 1), 0, 1);
|
|
|
|
test::check<
|
|
boost::parameter::parameters<
|
|
test::tag::x
|
|
, boost::parameter::optional<
|
|
boost::parameter::deduced<test::tag::y>
|
|
, boost::mpl::if_<
|
|
boost::is_same<
|
|
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
boost::mpl::_1
|
|
, boost::remove_reference<
|
|
boost::parameter::binding<
|
|
boost::mpl::_2
|
|
, test::tag::x
|
|
>
|
|
>
|
|
#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
|
boost::add_lvalue_reference<boost::mpl::_1>
|
|
, boost::parameter::binding<boost::mpl::_2,test::tag::x>
|
|
#endif // Borland workarounds needed.
|
|
>
|
|
, boost::mpl::true_
|
|
, boost::mpl::false_
|
|
>
|
|
>
|
|
>
|
|
>((test::_x = 0U, test::_y = 1U), 0U, 1U);
|
|
|
|
test::check<
|
|
boost::parameter::parameters<
|
|
test::tag::x
|
|
, boost::parameter::optional<
|
|
boost::parameter::deduced<test::tag::y>
|
|
, boost::mpl::if_<
|
|
boost::is_convertible<boost::mpl::_1,test::tag::x::_>
|
|
, boost::mpl::true_
|
|
, boost::mpl::false_
|
|
>
|
|
>
|
|
>
|
|
>((test::_x = 0U, test::_y = 1U), 0U, 1U);
|
|
|
|
test::check<
|
|
boost::parameter::parameters<
|
|
test::tag::x
|
|
, boost::parameter::optional<
|
|
boost::parameter::deduced<test::tag::y>
|
|
, boost::mpl::if_<
|
|
boost::is_convertible<boost::mpl::_1,test::tag::x::_1>
|
|
, boost::mpl::true_
|
|
, boost::mpl::false_
|
|
>
|
|
>
|
|
>
|
|
>((test::_x = 0U, test::_y = 1U), 0U, 1U);
|
|
|
|
return boost::report_errors();
|
|
}
|
|
|