• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Copyright 2017, 2019 Peter Dimov.
3 //
4 // Distributed under the Boost Software License, Version 1.0.
5 //
6 // See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt
8 
9 
10 #include <boost/mp11/mpl_tuple.hpp>
11 #include <tuple>
12 
13 #include <boost/mpl/at.hpp>
14 #include <boost/mpl/size.hpp>
15 
16 #include <boost/core/lightweight_test_trait.hpp>
17 
main()18 int main()
19 {
20     namespace mpl = boost::mpl;
21     using namespace boost::mp11;
22 
23     using L1 = std::tuple<char, int, float>;
24 
25     BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at<L1, mpl::int_<0>>::type, mp_at_c<L1, 0>>));
26     BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at<L1, mpl::int_<1>>::type, mp_at_c<L1, 1>>));
27     BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at<L1, mpl::int_<2>>::type, mp_at_c<L1, 2>>));
28 
29     BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at_c<L1, 0>::type, mp_at_c<L1, 0>>));
30     BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at_c<L1, 1>::type, mp_at_c<L1, 1>>));
31     BOOST_TEST_TRAIT_TRUE((std::is_same<typename mpl::at_c<L1, 2>::type, mp_at_c<L1, 2>>));
32 
33     BOOST_TEST_EQ((mpl::size<L1>::type::value), mp_size<L1>::value);
34 
35     return boost::report_errors();
36 }
37