1
2 // Copyright 2019 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/set.hpp>
11 #include <boost/mp11/list.hpp>
12 #include <boost/core/lightweight_test_trait.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_set_intersection;
21
22 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<>, mp_list<>>));
23 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<>>, mp_list<>>));
24 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void>>, mp_list<void>>));
25 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int>>, mp_list<void, int>>));
26 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float>>, mp_list<void, int, float>>));
27
28 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<>, std::pair<float, int>>, std::tuple<>>));
29 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<void>, std::pair<float, int>>, std::tuple<>>));
30 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<void, int>, std::pair<float, int>>, std::tuple<int>>));
31 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<void, int, float>, std::pair<float, int>>, std::tuple<int, float>>));
32
33 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float>, std::tuple<>>, mp_list<>>));
34 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float>, std::tuple<int>>, mp_list<int>>));
35 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float>, std::tuple<float, void>>, mp_list<void, float>>));
36 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float>, std::tuple<float, void, int>>, mp_list<void, int, float>>));
37
38 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<>, mp_list<>, std::pair<float, int>>, std::tuple<>>));
39 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<void>, mp_list<double>, std::pair<float, int>>, std::tuple<>>));
40 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<void, int>, mp_list<double, int>, std::pair<float, int>>, std::tuple<int>>));
41 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<std::tuple<void, int, float>, mp_list<double, int, float>, std::pair<float, int>>, std::tuple<int, float>>));
42
43 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float, double>, std::pair<double, void>, std::tuple<>>, mp_list<>>));
44 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float, double>, std::pair<double, void>, std::tuple<int>>, mp_list<>>));
45 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float, double>, std::pair<double, void>, std::tuple<float, void>>, mp_list<void>>));
46 BOOST_TEST_TRAIT_TRUE((std::is_same<mp_set_intersection<mp_list<void, int, float, double>, std::pair<double, void>, std::tuple<float, void, int>>, mp_list<void>>));
47
48 return boost::report_errors();
49 }
50