foldable.cpp 920 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/assert.hpp>
  5. #include <boost/hana/equal.hpp>
  6. #include <boost/hana/pair.hpp>
  7. #include <boost/hana/tuple.hpp>
  8. #include <boost/hana/unpack.hpp>
  9. #include <laws/base.hpp>
  10. #include <laws/foldable.hpp>
  11. namespace hana = boost::hana;
  12. using hana::test::ct_eq;
  13. int main() {
  14. hana::test::_injection<0> f{};
  15. BOOST_HANA_CONSTANT_CHECK(hana::equal(
  16. hana::unpack(hana::make_pair(ct_eq<1>{}, ct_eq<2>{}), f),
  17. f(ct_eq<1>{}, ct_eq<2>{})
  18. ));
  19. hana::test::TestFoldable<hana::pair_tag>{hana::make_tuple(
  20. hana::make_pair(ct_eq<3>{}, ct_eq<3>{})
  21. , hana::make_pair(ct_eq<3>{}, ct_eq<4>{})
  22. , hana::make_pair(ct_eq<4>{}, ct_eq<3>{})
  23. , hana::make_pair(ct_eq<4>{}, ct_eq<4>{})
  24. )};
  25. }