// Copyright 2017 Peter Dimov. // // 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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template using add_pointer_t = typename std::add_pointer::type; template void test() { namespace mpl = boost::mpl; using namespace boost::mp11; // intrinsics BOOST_TEST_TRAIT_TRUE((std::is_same>::type, mp_at_c>)); BOOST_TEST_TRAIT_TRUE((std::is_same>::type, mp_at_c>)); BOOST_TEST_TRAIT_TRUE((std::is_same>::type, mp_at_c>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_at_c>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_at_c>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_at_c>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, float>)); BOOST_TEST_EQ((mpl::distance::type, typename mpl::end::type>::type::value), mp_size::value); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_clear>)); BOOST_TEST_TRAIT_FALSE((typename mpl::empty::type)); BOOST_TEST_TRAIT_TRUE((typename mpl::empty>::type)); BOOST_TEST_TRAIT_TRUE((std::is_same::type>::type, mp_pop_front>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_front>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, void>::type, mp_push_front>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, void>::type, mp_push_back>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, L1>::type, mp_append>)); BOOST_TEST_TRAIT_TRUE((typename mpl::is_sequence::type)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_pop_front>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_push_back>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_push_front>)); BOOST_TEST_EQ((mpl::size::type::value), mp_size::value); // algorithms BOOST_TEST_TRAIT_TRUE((std::is_same>::type, mp_transform>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_reverse>)); BOOST_TEST_TRAIT_TRUE((std::is_same::type, mp_remove>)); using L2 = typename mpl::copy>>::type; using L3 = typename mpl::copy>>::type; BOOST_TEST_TRAIT_TRUE((std::is_same)); } int main() { using boost::mp11::mp_list; test>(); test>(); // MPL instantiates the tuple, so no 'void' return boost::report_errors(); }