• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 // Copyright 2015, 2017 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/utility.hpp>
11 #include <boost/mp11/algorithm.hpp>
12 #include <boost/core/lightweight_test_trait.hpp>
13 #include <type_traits>
14 
15 using boost::mp11::mp_valid;
16 using boost::mp11::mp_at;
17 using boost::mp11::mp_size_t;
18 using boost::mp11::mp_list;
19 
main()20 int main()
21 {
22     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at>));
23     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, void>));
24     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, void, void>));
25     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, void, void, void>));
26 
27     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, void, mp_size_t<0>>));
28 
29     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, mp_list<>, mp_size_t<0>>));
30 
31     BOOST_TEST_TRAIT_TRUE((mp_valid<mp_at, mp_list<void>, mp_size_t<0>>));
32     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, mp_list<void>, mp_size_t<1>>));
33 
34     BOOST_TEST_TRAIT_TRUE((mp_valid<mp_at, mp_list<void, void>, mp_size_t<0>>));
35     BOOST_TEST_TRAIT_TRUE((mp_valid<mp_at, mp_list<void, void>, mp_size_t<1>>));
36     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_at, mp_list<void, void>, mp_size_t<2>>));
37 
38     return boost::report_errors();
39 }
40