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/algorithm.hpp>
11 #include <boost/mp11/utility.hpp>
12 #include <boost/mp11/list.hpp>
13 #include <boost/mp11/detail/config.hpp>
14 #include <boost/core/lightweight_test_trait.hpp>
15
16 using boost::mp11::mp_transform;
17 using boost::mp11::mp_list;
18 using boost::mp11::mp_valid;
19
20 template<class...> using F = void;
21
22 template<class... L> using transform = mp_transform<F, L...>;
23
main()24 int main()
25 {
26 BOOST_TEST_TRAIT_FALSE((mp_valid<transform>));
27 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void>));
28 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void, void>));
29 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void, void, void>));
30 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void, void, void, void>));
31 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, void, void, void, void, void>));
32
33 #if !BOOST_MP11_WORKAROUND( BOOST_MP11_MSVC, <= 1800 )
34 BOOST_TEST_TRAIT_TRUE((mp_valid<transform, mp_list<>>));
35 #endif
36
37 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, mp_list<>, mp_list<void>>));
38 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, mp_list<>, mp_list<>, mp_list<void>>));
39 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, mp_list<>, mp_list<>, mp_list<>, mp_list<void>>));
40 BOOST_TEST_TRAIT_FALSE((mp_valid<transform, mp_list<>, mp_list<>, mp_list<>, mp_list<>, mp_list<void>>));
41
42 return boost::report_errors();
43 }
44