laws.cpp 931 B

123456789101112131415161718192021222324252627282930313233
  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/set.hpp>
  5. #include <boost/hana/tuple.hpp>
  6. #include <laws/base.hpp>
  7. #include <laws/comparable.hpp>
  8. #include <laws/foldable.hpp>
  9. #include <laws/searchable.hpp>
  10. namespace hana = boost::hana;
  11. using hana::test::ct_eq;
  12. int main() {
  13. auto eqs = hana::make_tuple(
  14. hana::make_set(),
  15. hana::make_set(ct_eq<0>{}),
  16. hana::make_set(ct_eq<0>{}, ct_eq<1>{}),
  17. hana::make_set(ct_eq<1>{}, ct_eq<0>{}),
  18. hana::make_set(ct_eq<0>{}, ct_eq<1>{}, ct_eq<2>{})
  19. );
  20. auto keys = hana::make_tuple(
  21. ct_eq<2>{},
  22. ct_eq<3>{}
  23. );
  24. hana::test::TestComparable<hana::set_tag>{eqs};
  25. hana::test::TestSearchable<hana::set_tag>{eqs, keys};
  26. hana::test::TestFoldable<hana::set_tag>{eqs};
  27. }