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