• 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 <boost/mp11/integral.hpp>
13 #include <type_traits>
14 #include <tuple>
15 #include <utility>
16 
main()17 int main()
18 {
19     using boost::mp11::mp_list;
20     using boost::mp11::mp_empty;
21     using boost::mp11::mp_true;
22     using boost::mp11::mp_false;
23 
24     using L1 = mp_list<>;
25     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L1>, mp_true>));
26 
27     using L2 = mp_list<void>;
28     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L2>, mp_false>));
29 
30     using L3 = mp_list<int[], void, float>;
31     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L3>, mp_false>));
32 
33     using L4 = std::tuple<>;
34     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L4>, mp_true>));
35 
36     using L5 = std::tuple<int>;
37     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L5>, mp_false>));
38 
39     using L6 = std::tuple<int, int>;
40     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L6>, mp_false>));
41 
42     using L7 = std::pair<char, double>;
43     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L7>, mp_false>));
44 
45     using L8 = std::add_const<void()>;
46     BOOST_TEST_TRAIT_TRUE((std::is_same<mp_empty<L8>, mp_false>));
47 
48     return boost::report_errors();
49 }
50