boost_no_char16_t.ipp 906 B

1234567891011121314151617181920212223242526272829303132
  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_CHAR16_T
  7. // TITLE: C++0x char16_t unavailable
  8. // DESCRIPTION: The compiler does not support C++0x char16_t
  9. namespace boost_no_cxx11_char16_t {
  10. // Microsoft VC++ 2010, and possibly other compilers, provides
  11. // a typedef for char16_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 char16_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 char16_t p(0);
  21. f(&p);
  22. return 0;
  23. }
  24. }