boost_no_unicode_literals.ipp 928 B

12345678910111213141516171819202122232425262728293031323334
  1. // (C) Copyright Beman Dawes 2008
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for more information.
  6. // MACRO: BOOST_NO_CXX11_UNICODE_LITERALS
  7. // TITLE: C++0x unicode literals unavailable
  8. // DESCRIPTION: The compiler does not support C++0x Unicode literals (N2442)
  9. namespace boost_no_cxx11_unicode_literals {
  10. template <class CharT>
  11. void quiet_warning(const CharT*){}
  12. int test()
  13. {
  14. #if defined(__cpp_char8_type) || defined(__cpp_char8_t)
  15. // The change to char8_t in C++20 is a breaking change to the std:
  16. const char8_t* c8 = u8"";
  17. #else
  18. const char* c8 = u8"";
  19. #endif
  20. const char16_t* c16 = u"";
  21. const char32_t* c32 = U"";
  22. quiet_warning(c8);
  23. quiet_warning(c16);
  24. quiet_warning(c32);
  25. return 0;
  26. }
  27. }