comparable.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/equal.hpp>
  6. #include <boost/hana/not.hpp>
  7. #include "matrix/comparable.hpp"
  8. namespace hana = boost::hana;
  9. using namespace cppcon;
  10. int main() {
  11. BOOST_HANA_CONSTEXPR_CHECK(hana::equal(
  12. matrix(row(1, 2)),
  13. matrix(row(1, 2))
  14. ));
  15. BOOST_HANA_CONSTEXPR_CHECK(hana::not_(hana::equal(
  16. matrix(row(1, 2)),
  17. matrix(row(1, 5))
  18. )));
  19. BOOST_HANA_CONSTEXPR_CHECK(hana::equal(
  20. matrix(row(1, 2),
  21. row(3, 4)),
  22. matrix(row(1, 2),
  23. row(3, 4))
  24. ));
  25. BOOST_HANA_CONSTEXPR_CHECK(hana::not_(hana::equal(
  26. matrix(row(1, 2),
  27. row(3, 4)),
  28. matrix(row(1, 2),
  29. row(0, 4))
  30. )));
  31. BOOST_HANA_CONSTEXPR_CHECK(hana::not_(hana::equal(
  32. matrix(row(1, 2),
  33. row(3, 4)),
  34. matrix(row(0, 2),
  35. row(3, 4))
  36. )));
  37. BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
  38. matrix(row(1),
  39. row(2)),
  40. matrix(row(3, 4),
  41. row(5, 6))
  42. )));
  43. BOOST_HANA_CONSTANT_CHECK(hana::not_(hana::equal(
  44. matrix(row(1),
  45. row(2)),
  46. matrix(row(3, 4))
  47. )));
  48. }