values.cpp 865 B

1234567891011121314151617181920212223242526272829
  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/contains.hpp>
  6. #include <boost/hana/integral_constant.hpp>
  7. #include <boost/hana/map.hpp>
  8. #include <boost/hana/pair.hpp>
  9. #include <boost/hana/permutations.hpp>
  10. #include <boost/hana/tuple.hpp>
  11. #include <boost/hana/type.hpp>
  12. #include <string>
  13. namespace hana = boost::hana;
  14. using namespace std::literals;
  15. int main() {
  16. auto m = hana::make_map(
  17. hana::make_pair(hana::int_c<1>, "foobar"s),
  18. hana::make_pair(hana::type_c<void>, 1234)
  19. );
  20. // The order of the values is unspecified.
  21. BOOST_HANA_RUNTIME_CHECK(
  22. hana::values(m) ^hana::in^ hana::permutations(hana::make_tuple("foobar"s, 1234))
  23. );
  24. }