• 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/greater.hpp>
7 #include <boost/hana/greater_equal.hpp>
8 #include <boost/hana/less.hpp>
9 #include <boost/hana/less_equal.hpp>
10 #include <boost/hana/not.hpp>
11 #include <boost/hana/optional.hpp>
12 
13 #include <laws/base.hpp>
14 namespace hana = boost::hana;
15 using hana::test::ct_ord;
16 
17 
18 struct undefined { };
19 
main()20 int main() {
21     BOOST_HANA_CONSTANT_CHECK(hana::nothing < hana::just(undefined{}));
22     BOOST_HANA_CONSTANT_CHECK(hana::just(ct_ord<3>{}) < hana::just(ct_ord<4>{}));
23     BOOST_HANA_CONSTANT_CHECK(hana::just(ct_ord<3>{}) <= hana::just(ct_ord<4>{}));
24     BOOST_HANA_CONSTANT_CHECK(hana::just(ct_ord<4>{}) > hana::just(ct_ord<3>{}));
25     BOOST_HANA_CONSTANT_CHECK(hana::just(ct_ord<4>{}) >= hana::just(ct_ord<3>{}));
26 
27     BOOST_HANA_CONSTANT_CHECK(hana::less(
28         hana::nothing,
29         hana::just(undefined{})
30     ));
31     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less(
32         hana::just(undefined{}),
33         hana::nothing
34     )));
35     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less(
36         hana::nothing,
37         hana::nothing
38     )));
39 
40     BOOST_HANA_CONSTANT_CHECK(hana::less(
41         hana::just(ct_ord<3>{}),
42         hana::just(ct_ord<4>{})
43     ));
44     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less(
45         hana::just(ct_ord<3>{}),
46         hana::just(ct_ord<3>{})
47     )));
48     BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::less(
49         hana::just(ct_ord<4>{}),
50         hana::just(ct_ord<3>{})
51     )));
52 }
53