type.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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/experimental/printable.hpp>
  5. #include <boost/hana/type.hpp>
  6. #include <iostream>
  7. namespace hana = boost::hana;
  8. template <typename ...T>
  9. struct Template { };
  10. int main() {
  11. // Since demangling may not always be available, and since that's not
  12. // our job to test this (but Boost.Core's job), we don't test the
  13. // actual demangling of types. We merely print a type to make sure
  14. // things don't blow up stupidly, but we can't really test more than
  15. // that.
  16. std::cout << hana::experimental::print(hana::type_c<void>) << std::endl;
  17. std::cout << hana::experimental::print(hana::type_c<int>) << std::endl;
  18. std::cout << hana::experimental::print(hana::type_c<int const>) << std::endl;
  19. std::cout << hana::experimental::print(hana::type_c<int&>) << std::endl;
  20. std::cout << hana::experimental::print(hana::type_c<int const&>) << std::endl;
  21. std::cout << hana::experimental::print(hana::type_c<int(&)[]>) << std::endl;
  22. std::cout << hana::experimental::print(hana::type_c<Template<void, char const*>>) << std::endl;
  23. }