| 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/bool.hpp> |
| 6 | #include <boost/hana/ext/std/tuple.hpp> |
| 7 | #include <boost/hana/tuple.hpp> |
| 8 | |
| 9 | #include <laws/base.hpp> |
| 10 | #include <laws/searchable.hpp> |
| 11 | |
| 12 | #include <tuple> |
| 13 | namespace hana = boost::hana; |
| 14 | using hana::test::ct_eq; |
| 15 | |
| 16 | |
| 17 | int main() { |
| 18 | auto tuples = hana::make_tuple( |
| 19 | std::make_tuple() |
| 20 | , std::make_tuple(ct_eq<0>{}) |
| 21 | , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}) |
| 22 | , std::make_tuple(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{}) |
| 23 | ); |
| 24 | auto keys = hana::make_tuple(ct_eq<3>{}, ct_eq<5>{}, ct_eq<7>{}); |
| 25 | |
| 26 | auto bool_tuples = hana::make_tuple( |
| 27 | std::make_tuple(args: hana::true_c) |
| 28 | , std::make_tuple(args: hana::false_c) |
| 29 | , std::make_tuple(args: hana::true_c, args: hana::true_c) |
| 30 | , std::make_tuple(args: hana::true_c, args: hana::false_c) |
| 31 | , std::make_tuple(args: hana::false_c, args: hana::true_c) |
| 32 | , std::make_tuple(args: hana::false_c, args: hana::false_c) |
| 33 | ); |
| 34 | auto bool_keys = hana::make_tuple(hana::true_c, hana::false_c); |
| 35 | |
| 36 | hana::test::TestSearchable<hana::ext::std::tuple_tag>{tuples, keys}; |
| 37 | hana::test::TestSearchable<hana::ext::std::tuple_tag>{bool_tuples, bool_keys}; |
| 38 | } |
| 39 | |