macro.cpp 977 B

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/equal.hpp>
  6. #include <boost/hana/string.hpp>
  7. #include <type_traits>
  8. namespace hana = boost::hana;
  9. int main() {
  10. // make sure string_c and BOOST_HANA_STRING give the same result
  11. {
  12. auto const s1 = BOOST_HANA_STRING("");
  13. auto const s2 = hana::string_c<>;
  14. static_assert(std::is_same<decltype(s1), decltype(s2)>::value, "");
  15. }
  16. {
  17. auto const s1 = BOOST_HANA_STRING("a");
  18. auto const s2 = hana::string_c<'a'>;
  19. static_assert(std::is_same<decltype(s1), decltype(s2)>::value, "");
  20. }
  21. {
  22. auto const s1 = BOOST_HANA_STRING("abcd");
  23. auto const s2 = hana::string_c<'a', 'b', 'c', 'd'>;
  24. static_assert(std::is_same<decltype(s1), decltype(s2)>::value, "");
  25. }
  26. }