boost_no_char32_t.ipp 905 B

12345678910111213141516171819202122232425262728293031
  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_CHAR32_T
  7. // TITLE: C++0x char32_t unavailable
  8. // DESCRIPTION: The compiler does not support C++0x char32_t
  9. namespace boost_no_cxx11_char32_t {
  10. // Microsoft VC++ 2010, and possibly other compilers, provides
  11. // a typedef for char32_t rather than a new type. We want that
  12. // to be an error, so provide an overloaded function that will
  13. // be ambiguous if char16_t is just a typedef.
  14. void f(const char32_t*){}
  15. void f(const unsigned short*){}
  16. void f(const unsigned int*){}
  17. void f(const unsigned long*){}
  18. int test()
  19. {
  20. const char32_t p(0);
  21. f(&p);
  22. return 0;
  23. }
  24. }