• 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/core/make.hpp>
7 #include <boost/hana/equal.hpp>
8 #include <boost/hana/integral_constant.hpp>
9 #include <boost/hana/not_equal.hpp> // for operator !=
10 #include <boost/hana/range.hpp>
11 namespace hana = boost::hana;
12 
13 
main()14 int main() {
15     BOOST_HANA_CONSTANT_CHECK(
16         hana::make_range(hana::int_c<0>, hana::int_c<0>) ==
17         hana::make_range(hana::int_c<0>, hana::int_c<0>)
18     );
19     BOOST_HANA_CONSTANT_CHECK(
20         hana::make_range(hana::int_c<0>, hana::int_c<4>) !=
21         hana::make_range(hana::int_c<0>, hana::int_c<0>)
22     );
23 
24     BOOST_HANA_CONSTANT_CHECK(hana::equal(
25         hana::make_range(hana::int_c<0>, hana::int_c<0>),
26         hana::make_range(hana::int_c<0>, hana::int_c<0>)
27     ));
28     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
29         hana::make_range(hana::int_c<0>, hana::int_c<0>),
30         hana::make_range(hana::int_c<0>, hana::int_c<1>)
31     )));
32     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
33         hana::make_range(hana::int_c<0>, hana::int_c<1>),
34         hana::make_range(hana::int_c<0>, hana::int_c<0>)
35     )));
36     BOOST_HANA_CONSTANT_CHECK(hana::equal(
37         hana::make_range(hana::int_c<0>, hana::int_c<1>),
38         hana::make_range(hana::int_c<0>, hana::int_c<1>)
39     ));
40     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
41         hana::make_range(hana::int_c<0>, hana::int_c<2>),
42         hana::make_range(hana::int_c<0>, hana::int_c<1>)
43     )));
44     BOOST_HANA_CONSTANT_CHECK(hana::equal(
45         hana::make_range(hana::int_c<0>, hana::int_c<2>),
46         hana::make_range(hana::int_c<0>, hana::int_c<2>)
47     ));
48     BOOST_HANA_CONSTANT_CHECK(hana::equal(
49         hana::make_range(hana::int_c<0>, hana::int_c<0>),
50         hana::make_range(hana::int_c<2>, hana::int_c<2>)
51     ));
52 
53     BOOST_HANA_CONSTANT_CHECK(hana::equal(
54         hana::make_range(hana::int_c<2>, hana::int_c<4>),
55         hana::make_range(hana::int_c<2>, hana::int_c<4>)
56     ));
57     BOOST_HANA_CONSTANT_CHECK(hana::equal(
58         hana::make_range(hana::int_c<-4>, hana::int_c<-3>),
59         hana::make_range(hana::int_c<-4>, hana::int_c<-3>)
60     ));
61     BOOST_HANA_CONSTANT_CHECK(hana::equal(
62         hana::make_range(hana::int_c<-4>, hana::int_c<2>),
63         hana::make_range(hana::int_c<-4>, hana::int_c<2>)
64     ));
65 }
66