github_234.cpp 1.0 KB

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/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/set.hpp>
  10. namespace hana = boost::hana;
  11. int main() {
  12. {
  13. auto set = hana::make_set(hana::int_c<1>, hana::integral_c<signed char, 'x'>);
  14. BOOST_HANA_CONSTANT_CHECK(hana::contains(set, hana::int_c<1>));
  15. BOOST_HANA_CONSTANT_CHECK(hana::contains(set, hana::integral_c<signed char, 'x'>));
  16. }
  17. {
  18. auto map = hana::make_map(
  19. hana::make_pair(hana::int_c<1>, 1),
  20. hana::make_pair(hana::integral_c<signed char, 'x'>, 'x')
  21. );
  22. BOOST_HANA_CONSTANT_CHECK(hana::contains(map, hana::int_c<1>));
  23. BOOST_HANA_CONSTANT_CHECK(hana::contains(map, hana::integral_c<signed char, 'x'>));
  24. }
  25. }