arithmetic.cpp 1021 B

12345678910111213141516171819202122232425262728293031
  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/ext/std/integral_constant.hpp>
  5. #include <boost/hana/tuple.hpp>
  6. #include <laws/euclidean_ring.hpp>
  7. #include <laws/group.hpp>
  8. #include <laws/monoid.hpp>
  9. #include <laws/ring.hpp>
  10. #include <type_traits>
  11. namespace hana = boost::hana;
  12. int main() {
  13. auto ints = hana::make_tuple(
  14. std::integral_constant<int, -10>{},
  15. std::integral_constant<int, -2>{},
  16. std::integral_constant<int, 0>{},
  17. std::integral_constant<int, 1>{},
  18. std::integral_constant<int, 3>{}
  19. );
  20. hana::test::TestMonoid<hana::ext::std::integral_constant_tag<int>>{ints};
  21. hana::test::TestGroup<hana::ext::std::integral_constant_tag<int>>{ints};
  22. hana::test::TestRing<hana::ext::std::integral_constant_tag<int>>{ints};
  23. hana::test::TestEuclideanRing<hana::ext::std::integral_constant_tag<int>>{ints};
  24. }