tag.cpp 763 B

1234567891011121314151617181920212223242526
  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/core/tag_of.hpp>
  5. #include <boost/hana/ext/std/integral_constant.hpp>
  6. #include <boost/hana/integral_constant.hpp>
  7. #include <type_traits>
  8. namespace hana = boost::hana;
  9. // Make sure we have the right tag, even when including ext/std/integral_constant.hpp
  10. static_assert(std::is_same<
  11. hana::tag_of_t<hana::integral_constant<int, 10>>,
  12. hana::integral_constant_tag<int>
  13. >{}, "");
  14. struct derived : hana::integral_constant<int, 10> { };
  15. static_assert(std::is_same<
  16. hana::tag_of_t<derived>,
  17. hana::integral_constant_tag<int>
  18. >{}, "");
  19. int main() { }