]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/test/ext/boost/tuple/searchable.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / hana / test / ext / boost / tuple / searchable.cpp
1 // Copyright Louis Dionne 2013-2017
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/ext/boost/tuple.hpp>
6
7 #include <boost/hana/bool.hpp>
8 #include <boost/hana/tuple.hpp>
9
10 #include <laws/base.hpp>
11 #include <laws/searchable.hpp>
12
13 #include <boost/tuple/tuple.hpp>
14 namespace hana = boost::hana;
15
16
17 template <int i>
18 using eq = hana::test::ct_eq<i>;
19
20 int main() {
21 //////////////////////////////////////////////////////////////////////////
22 // Setup for the laws below
23 //////////////////////////////////////////////////////////////////////////
24 auto eq_tuples = hana::make_tuple(
25 ::boost::make_tuple()
26 , ::boost::make_tuple(eq<0>{})
27 , ::boost::make_tuple(eq<0>{}, eq<1>{})
28 , ::boost::make_tuple(eq<0>{}, eq<1>{}, eq<2>{})
29 );
30
31 auto eq_tuple_keys = hana::make_tuple(
32 eq<3>{}, eq<5>{}, eq<7>{}
33 );
34
35 //////////////////////////////////////////////////////////////////////////
36 // Searchable
37 //////////////////////////////////////////////////////////////////////////
38 {
39 hana::test::TestSearchable<hana::ext::boost::tuple_tag>{eq_tuples, eq_tuple_keys};
40
41 auto bools = hana::make_tuple(
42 ::boost::make_tuple(hana::true_c)
43 , ::boost::make_tuple(hana::false_c)
44 , ::boost::make_tuple(hana::true_c, hana::true_c)
45 , ::boost::make_tuple(hana::true_c, hana::false_c)
46 , ::boost::make_tuple(hana::false_c, hana::true_c)
47 , ::boost::make_tuple(hana::false_c, hana::false_c)
48 );
49 hana::test::TestSearchable<hana::ext::boost::tuple_tag>{
50 bools,
51 hana::make_tuple(hana::true_c, hana::false_c)
52 };
53 }
54 }