]>
Commit | Line | Data |
---|---|---|
1 | // Copyright Louis Dionne 2013-2022 | |
2 | // Distributed under the Boost Software License, Version 1.0. | |
3 | // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) | |
4 | ||
5 | #include <boost/hana/assert.hpp> | |
6 | #include <boost/hana/equal.hpp> | |
7 | #include <boost/hana/set.hpp> | |
8 | #include <boost/hana/union.hpp> | |
9 | ||
10 | #include <laws/base.hpp> | |
11 | namespace hana = boost::hana; | |
12 | using hana::test::ct_eq; | |
13 | ||
14 | ||
15 | int main() { | |
16 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
17 | hana::union_( | |
18 | hana::make_set(), | |
19 | hana::make_set() | |
20 | ), | |
21 | hana::make_set() | |
22 | )); | |
23 | ||
24 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
25 | hana::union_( | |
26 | hana::make_set(ct_eq<0>{}), | |
27 | hana::make_set() | |
28 | ), | |
29 | hana::make_set(ct_eq<0>{}) | |
30 | )); | |
31 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
32 | hana::union_( | |
33 | hana::make_set(), | |
34 | hana::make_set(ct_eq<0>{}) | |
35 | ), | |
36 | hana::make_set(ct_eq<0>{}) | |
37 | )); | |
38 | ||
39 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
40 | hana::union_( | |
41 | hana::make_set(ct_eq<0>{}), | |
42 | hana::make_set(ct_eq<0>{}) | |
43 | ), | |
44 | hana::make_set(ct_eq<0>{}) | |
45 | )); | |
46 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
47 | hana::union_( | |
48 | hana::make_set(ct_eq<0>{}), | |
49 | hana::make_set(ct_eq<1>{}) | |
50 | ), | |
51 | hana::make_set(ct_eq<0>{}, ct_eq<1>{}) | |
52 | )); | |
53 | ||
54 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
55 | hana::union_( | |
56 | hana::make_set(ct_eq<0>{}, ct_eq<1>{}), | |
57 | hana::make_set(ct_eq<1>{}) | |
58 | ), | |
59 | hana::make_set(ct_eq<0>{}, ct_eq<1>{}) | |
60 | )); | |
61 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
62 | hana::union_( | |
63 | hana::make_set(ct_eq<0>{}), | |
64 | hana::make_set(ct_eq<1>{}, ct_eq<0>{}) | |
65 | ), | |
66 | hana::make_set(ct_eq<0>{}, ct_eq<1>{}) | |
67 | )); | |
68 | ||
69 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
70 | hana::union_( | |
71 | hana::make_set(ct_eq<0>{}, ct_eq<2>{}), | |
72 | hana::make_set(ct_eq<1>{}) | |
73 | ), | |
74 | hana::make_set(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}) | |
75 | )); | |
76 | ||
77 | BOOST_HANA_CONSTANT_CHECK(hana::equal( | |
78 | hana::union_( | |
79 | hana::make_set(ct_eq<0>{}, ct_eq<2>{}, ct_eq<5>{}), | |
80 | hana::make_set(ct_eq<1>{}, ct_eq<3>{}, ct_eq<4>{}) | |
81 | ), | |
82 | hana::make_set(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}, ct_eq<3>{}, ct_eq<4>{}, ct_eq<5>{}) | |
83 | )); | |
84 | } |