]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/set/equal.cpp
1 // Copyright Louis Dionne 2013-2016
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)
5 #include <boost/hana/assert.hpp>
6 #include <boost/hana/core/to.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/for_each.hpp>
9 #include <boost/hana/not.hpp>
10 #include <boost/hana/not_equal.hpp> // for operator !=
11 #include <boost/hana/permutations.hpp>
12 #include <boost/hana/set.hpp>
13 #include <boost/hana/tuple.hpp>
15 #include <laws/base.hpp>
16 namespace hana
= boost::hana
;
17 using hana::test::ct_eq
;
21 auto check
= [](auto ...keys
) {
22 auto keys_set
= hana::make_set(keys
...);
23 auto keys_tuple
= hana::make_tuple(keys
...);
24 auto possible_arrangements
= hana::permutations(keys_tuple
);
26 hana::for_each(possible_arrangements
, [&](auto perm
) {
27 BOOST_HANA_CONSTANT_CHECK(hana::equal(
33 BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
35 hana::make_set(keys
..., ct_eq
<999>{})
41 check(ct_eq
<0>{}, ct_eq
<1>{});
42 check(ct_eq
<0>{}, ct_eq
<1>{}, ct_eq
<2>{});
45 BOOST_HANA_CONSTANT_CHECK(
46 hana::make_set(ct_eq
<0>{})
48 hana::make_set(ct_eq
<0>{})
51 BOOST_HANA_CONSTANT_CHECK(
52 hana::make_set(ct_eq
<0>{})
54 hana::make_set(ct_eq
<1>{})