• 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/assert.hpp>
6 #include <boost/hana/equal.hpp>
7 #include <boost/hana/not.hpp>
8 #include <boost/hana/tuple.hpp>
9 namespace hana = boost::hana;
10 
11 
12 struct x0;
13 struct x1;
14 struct x2;
15 
main()16 int main() {
17     // tuple_t
18     BOOST_HANA_CONSTANT_CHECK(hana::equal(
19         hana::tuple_t<>,
20         hana::tuple_t<>
21     ));
22     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
23         hana::tuple_t<x0>,
24         hana::tuple_t<>)
25     ));
26     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
27         hana::tuple_t<>,
28         hana::tuple_t<x0>)
29     ));
30     BOOST_HANA_CONSTANT_CHECK(hana::equal(
31         hana::tuple_t<x0>,
32         hana::tuple_t<x0>
33     ));
34     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
35         hana::tuple_t<x0, x1>,
36         hana::tuple_t<x0>)
37     ));
38     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
39         hana::tuple_t<x0>,
40         hana::tuple_t<x0, x1>)
41     ));
42     BOOST_HANA_CONSTANT_CHECK(hana::equal(
43         hana::tuple_t<x0, x1>,
44         hana::tuple_t<x0, x1>
45     ));
46     BOOST_HANA_CONSTANT_CHECK(hana::equal(
47         hana::tuple_t<x0, x1, x2>,
48         hana::tuple_t<x0, x1, x2>
49     ));
50 
51     // tuple_c
52     BOOST_HANA_CONSTANT_CHECK(hana::equal(
53         hana::tuple_c<int>,
54         hana::tuple_c<int>
55     ));
56     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
57         hana::tuple_c<int, 0>,
58         hana::tuple_c<int>
59     )));
60     BOOST_HANA_CONSTANT_CHECK(hana::equal(
61         hana::tuple_c<int, 0>,
62         hana::tuple_c<int, 0>
63     ));
64     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
65         hana::tuple_c<int, 0, 1>,
66         hana::tuple_c<int, 0>
67     )));
68     BOOST_HANA_CONSTANT_CHECK(hana::equal(
69         hana::tuple_c<int, 0, 1>,
70         hana::tuple_c<int, 0, 1>
71     ));
72     BOOST_HANA_CONSTANT_CHECK(hana::equal(
73         hana::tuple_c<int, 0, 1, 2>,
74         hana::tuple_c<int, 0, 1, 2>
75     ));
76 }
77