// Copyright 2023 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #if !defined(BOOST_MP11_HAS_TEMPLATE_AUTO) #pragma message("Test skipped because BOOST_MP11_HAS_TEMPLATE_AUTO is not defined") int main() {} #else #include #include #include template struct L1 {}; template struct L2 {}; template using double_ = boost::mp11::mp_value< N::value * 2 >; using Q_double = boost::mp11::mp_quote; template using is_zero = boost::mp11::mp_bool< N::value == 0 >; using Q_is_zero = boost::mp11::mp_quote; int main() { using boost::mp11::mp_transform_third; using boost::mp11::mp_transform_third_q; // BOOST_TEST_TRAIT_SAME(mp_transform_third, double_>, L1); BOOST_TEST_TRAIT_SAME(mp_transform_third_q, Q_double>, L1); BOOST_TEST_TRAIT_SAME(mp_transform_third, double_>, L1); BOOST_TEST_TRAIT_SAME(mp_transform_third_q, Q_double>, L1); // BOOST_TEST_TRAIT_SAME(mp_transform_third, is_zero>, L1<0, 1, false>); BOOST_TEST_TRAIT_SAME(mp_transform_third_q, Q_is_zero>, L1<0, 1, false>); BOOST_TEST_TRAIT_SAME(mp_transform_third, is_zero>, L1<0, 1, false, 3>); BOOST_TEST_TRAIT_SAME(mp_transform_third_q, Q_is_zero>, L1<0, 1, false, 3>); // BOOST_TEST_TRAIT_SAME(mp_transform_third, double_>, L2<3, 2, 2>); BOOST_TEST_TRAIT_SAME(mp_transform_third_q, Q_double>, L2<3, 2, 2>); BOOST_TEST_TRAIT_SAME(mp_transform_third, double_>, L2<3, 2, 2, 0>); BOOST_TEST_TRAIT_SAME(mp_transform_third_q, Q_double>, L2<3, 2, 2, 0>); // return boost::report_errors(); } #endif