• 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/detail/config.hpp>
12 #include <boost/core/lightweight_test_trait.hpp>
13 #include <type_traits>
14 
15 using boost::mp11::mp_invoke_q;
16 using boost::mp11::mp_quote;
17 using boost::mp11::mp_quote_trait;
18 using boost::mp11::mp_valid;
19 using boost::mp11::mp_identity;
20 using boost::mp11::mp_identity_t;
21 
main()22 int main()
23 {
24     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q>));
25     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, void>));
26     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, void, void>));
27     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, void, void, void>));
28 
29     using Qi = mp_quote<mp_identity_t>;
30 
31     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, Qi>));
32     BOOST_TEST_TRAIT_TRUE((mp_valid<mp_invoke_q, Qi, void>));
33     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, Qi, void, void>));
34 
35     using Qt = mp_quote_trait<mp_identity>;
36 
37 #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
38     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, Qt>));
39 #endif
40     BOOST_TEST_TRAIT_TRUE((mp_valid<mp_invoke_q, Qt, void>));
41     BOOST_TEST_TRAIT_FALSE((mp_valid<mp_invoke_q, Qt, void, void>));
42 
43     return boost::report_errors();
44 }
45