• 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/ext/boost/tuple.hpp>
6 
7 #include <boost/hana/tuple.hpp>
8 
9 #include <laws/comparable.hpp>
10 #include <laws/orderable.hpp>
11 
12 #include <boost/tuple/tuple.hpp>
13 namespace hana = boost::hana;
14 
15 
16 template <int i>
17 using eq = hana::test::ct_eq<i>;
18 
19 template <int i>
20 using ord = hana::test::ct_ord<i>;
21 
main()22 int main() {
23     //////////////////////////////////////////////////////////////////////////
24     // Setup for the laws below
25     //////////////////////////////////////////////////////////////////////////
26     auto eq_tuples = hana::make_tuple(
27           ::boost::make_tuple()
28         , ::boost::make_tuple(eq<0>{})
29         , ::boost::make_tuple(eq<0>{}, eq<1>{})
30         , ::boost::make_tuple(eq<0>{}, eq<1>{}, eq<2>{})
31         , ::boost::make_tuple(eq<0>{}, eq<1>{}, eq<2>{}, eq<3>{}, eq<4>{})
32     );
33 
34     auto ord_tuples = hana::make_tuple(
35           ::boost::make_tuple()
36         , ::boost::make_tuple(ord<0>{})
37         , ::boost::make_tuple(ord<0>{}, ord<1>{})
38         , ::boost::make_tuple(ord<0>{}, ord<1>{}, ord<2>{})
39         , ::boost::make_tuple(ord<0>{}, ord<1>{}, ord<2>{}, ord<3>{}, ord<4>{})
40     );
41 
42     //////////////////////////////////////////////////////////////////////////
43     // Comparable and Orderable
44     //////////////////////////////////////////////////////////////////////////
45     hana::test::TestComparable<hana::ext::boost::tuple_tag>{eq_tuples};
46     hana::test::TestOrderable<hana::ext::boost::tuple_tag>{ord_tuples};
47 }
48