github_354.cpp 785 B

1234567891011121314151617181920
  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/bool.hpp>
  5. #include <boost/hana/core/to.hpp>
  6. #include <boost/hana/integral_constant.hpp>
  7. namespace hana = boost::hana;
  8. static_assert(hana::is_convertible<hana::bool_<true>, bool>::value, "");
  9. static_assert(hana::to<bool>(hana::bool_c<true>) == true, "");
  10. static_assert(hana::is_convertible<hana::integral_constant<int, 1>, int>::value, "");
  11. static_assert(hana::to<int>(hana::integral_c<int, 1>) == 1, "");
  12. static_assert(hana::is_convertible<hana::integral_constant<long, 1l>, long>::value, "");
  13. static_assert(hana::to<long>(hana::integral_c<long, 1l>) == 1l, "");
  14. int main() { }