iterable.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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/boost/tuple.hpp>
  5. #include <boost/hana/tuple.hpp>
  6. #include <laws/base.hpp>
  7. #include <laws/foldable.hpp>
  8. #include <laws/iterable.hpp>
  9. #include <boost/tuple/tuple.hpp>
  10. namespace hana = boost::hana;
  11. template <int i>
  12. using eq = hana::test::ct_eq<i>;
  13. int main() {
  14. //////////////////////////////////////////////////////////////////////////
  15. // Setup for the laws below
  16. //////////////////////////////////////////////////////////////////////////
  17. auto eq_tuples = hana::make_tuple(
  18. ::boost::make_tuple()
  19. , ::boost::make_tuple(eq<0>{})
  20. , ::boost::make_tuple(eq<0>{}, eq<1>{})
  21. , ::boost::make_tuple(eq<0>{}, eq<1>{}, eq<2>{})
  22. );
  23. //////////////////////////////////////////////////////////////////////////
  24. // Foldable, Iterable
  25. //////////////////////////////////////////////////////////////////////////
  26. hana::test::TestFoldable<hana::ext::boost::tuple_tag>{eq_tuples};
  27. hana::test::TestIterable<hana::ext::boost::tuple_tag>{eq_tuples};
  28. }