| 1 | // Copyright Louis Dionne 2013-2022 |
| 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/pair.hpp> |
| 11 | #include <boost/hana/tuple.hpp> |
| 12 | |
| 13 | #include <laws/base.hpp> |
| 14 | #include <laws/orderable.hpp> |
| 15 | namespace hana = boost::hana; |
| 16 | using hana::test::ct_ord; |
| 17 | |
| 18 | |
| 19 | int main() { |
| 20 | BOOST_HANA_CONSTANT_CHECK( |
| 21 | hana::make_pair(ct_ord<1>{}, ct_ord<2>{}) < |
| 22 | hana::make_pair(ct_ord<3>{}, ct_ord<2>{}) |
| 23 | ); |
| 24 | |
| 25 | BOOST_HANA_CONSTANT_CHECK( |
| 26 | hana::make_pair(ct_ord<1>{}, ct_ord<2>{}) <= |
| 27 | hana::make_pair(ct_ord<3>{}, ct_ord<2>{}) |
| 28 | ); |
| 29 | |
| 30 | BOOST_HANA_CONSTANT_CHECK( |
| 31 | hana::make_pair(ct_ord<3>{}, ct_ord<2>{}) >= |
| 32 | hana::make_pair(ct_ord<1>{}, ct_ord<2>{}) |
| 33 | ); |
| 34 | |
| 35 | BOOST_HANA_CONSTANT_CHECK( |
| 36 | hana::make_pair(ct_ord<3>{}, ct_ord<2>{}) > |
| 37 | hana::make_pair(ct_ord<1>{}, ct_ord<2>{}) |
| 38 | ); |
| 39 | |
| 40 | hana::test::TestOrderable<hana::pair_tag>{hana::make_tuple( |
| 41 | hana::make_pair(ct_ord<3>{}, ct_ord<3>{}) |
| 42 | , hana::make_pair(ct_ord<3>{}, ct_ord<4>{}) |
| 43 | , hana::make_pair(ct_ord<4>{}, ct_ord<3>{}) |
| 44 | , hana::make_pair(ct_ord<4>{}, ct_ord<4>{}) |
| 45 | )}; |
| 46 | } |
| 47 | |