orderable.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #include <boost/hana/assert.hpp>
  5. #include <boost/hana/greater.hpp>
  6. #include <boost/hana/greater_equal.hpp>
  7. #include <boost/hana/less.hpp>
  8. #include <boost/hana/less_equal.hpp>
  9. #include <boost/hana/pair.hpp>
  10. #include <boost/hana/tuple.hpp>
  11. #include <laws/base.hpp>
  12. #include <laws/orderable.hpp>
  13. namespace hana = boost::hana;
  14. using hana::test::ct_ord;
  15. int main() {
  16. BOOST_HANA_CONSTANT_CHECK(
  17. hana::make_pair(ct_ord<1>{}, ct_ord<2>{}) <
  18. hana::make_pair(ct_ord<3>{}, ct_ord<2>{})
  19. );
  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. BOOST_HANA_CONSTANT_CHECK(
  25. hana::make_pair(ct_ord<3>{}, ct_ord<2>{}) >=
  26. hana::make_pair(ct_ord<1>{}, ct_ord<2>{})
  27. );
  28. BOOST_HANA_CONSTANT_CHECK(
  29. hana::make_pair(ct_ord<3>{}, ct_ord<2>{}) >
  30. hana::make_pair(ct_ord<1>{}, ct_ord<2>{})
  31. );
  32. hana::test::TestOrderable<hana::pair_tag>{hana::make_tuple(
  33. hana::make_pair(ct_ord<3>{}, ct_ord<3>{})
  34. , hana::make_pair(ct_ord<3>{}, ct_ord<4>{})
  35. , hana::make_pair(ct_ord<4>{}, ct_ord<3>{})
  36. , hana::make_pair(ct_ord<4>{}, ct_ord<4>{})
  37. )};
  38. }