• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/concept/struct.hpp>
6 #include <boost/hana/integral_constant.hpp>
7 #include <boost/hana/tuple.hpp>
8 
9 #include "minimal_struct.hpp"
10 #include <laws/base.hpp>
11 #include <laws/comparable.hpp>
12 #include <laws/foldable.hpp>
13 #include <laws/searchable.hpp>
14 namespace hana = boost::hana;
15 using hana::test::ct_eq;
16 
17 
main()18 int main() {
19     auto eq0 = hana::make_tuple(obj());
20     auto eq1 = hana::make_tuple(
21         obj(ct_eq<0>{}), obj(ct_eq<1>{}), obj(ct_eq<2>{})
22     );
23     auto eq2 = hana::make_tuple(
24         obj(ct_eq<0>{}, ct_eq<0>{}),
25         obj(ct_eq<0>{}, ct_eq<1>{}),
26         obj(ct_eq<1>{}, ct_eq<0>{}),
27         obj(ct_eq<1>{}, ct_eq<1>{}),
28         obj(ct_eq<0>{}, ct_eq<2>{}),
29         obj(ct_eq<2>{}, ct_eq<3>{})
30     );
31 
32     hana::test::TestComparable<minimal_struct_tag<0>>{eq0};
33     hana::test::TestComparable<minimal_struct_tag<1>>{eq1};
34     hana::test::TestComparable<minimal_struct_tag<2>>{eq2};
35 
36     hana::test::TestFoldable<minimal_struct_tag<0>>{eq0};
37     hana::test::TestFoldable<minimal_struct_tag<1>>{eq1};
38     hana::test::TestFoldable<minimal_struct_tag<2>>{eq2};
39 
40     hana::test::TestSearchable<minimal_struct_tag<0>>{eq0, hana::make_tuple()};
41     hana::test::TestSearchable<minimal_struct_tag<1>>{eq1, hana::make_tuple(hana::int_c<0>)};
42     hana::test::TestSearchable<minimal_struct_tag<2>>{eq2, hana::make_tuple(hana::int_c<0>, hana::int_c<1>)};
43 }
44