• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 //  Copyright 2015 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/core/lightweight_test_trait.hpp>
11 #include <boost/mp11/list.hpp>
12 #include <type_traits>
13 #include <tuple>
14 #include <utility>
15 
main()16 int main()
17 {
18     using boost::mp11::mp_list;
19     using boost::mp11::mp_front;
20     using boost::mp11::mp_first;
21 
22     using L1 = mp_list<void>;
23     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_front<L1>, void>));
24     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_first<L1>, void>));
25 
26     using L2 = mp_list<int[], void, float>;
27     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_front<L2>, int[]>));
28     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_first<L2>, int[]>));
29 
30     using L3 = std::tuple<int>;
31     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_front<L3>, int>));
32     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_first<L3>, int>));
33 
34     using L4 = std::pair<char, double>;
35     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_front<L4>, char>));
36     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_first<L4>, char>));
37 
38     using L5 = std::add_const<void()>;
39     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_front<L5>, void()>));
40     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_first<L5>, void()>));
41 
42     return boost::report_errors();
43 }
44