Initial support for char32_t

This commit is contained in:
Daniel James
2017-05-31 10:17:34 +01:00
parent 1706cb5937
commit 33eb0c50dc
2 changed files with 16 additions and 0 deletions

View File

@ -164,6 +164,12 @@ int main()
NUMERIC_TEST(unsigned char, uchar) NUMERIC_TEST(unsigned char, uchar)
#ifndef BOOST_NO_INTRINSIC_WCHAR_T #ifndef BOOST_NO_INTRINSIC_WCHAR_T
NUMERIC_TEST(wchar_t, wchar) NUMERIC_TEST(wchar_t, wchar)
#endif
#ifndef BOOST_NO_CXX11_CHAR16_T
NUMERIC_TEST(char16_t, char16)
#endif
#ifndef BOOST_NO_CXX11_CHAR32_T
NUMERIC_TEST(char32_t, char32)
#endif #endif
NUMERIC_TEST(short, short) NUMERIC_TEST(short, short)
NUMERIC_TEST(unsigned short, ushort) NUMERIC_TEST(unsigned short, ushort)

View File

@ -107,6 +107,16 @@ namespace boost
boost::hash_detail::enable_hash_value {}; boost::hash_detail::enable_hash_value {};
#endif #endif
#if !defined(BOOST_NO_CXX11_CHAR16_T)
template <> struct basic_numbers<char16_t> :
boost::hash_detail::enable_hash_value {};
#endif
#if !defined(BOOST_NO_CXX11_CHAR32_T)
template <> struct basic_numbers<char32_t> :
boost::hash_detail::enable_hash_value {};
#endif
// long_numbers is defined like this to allow for separate // long_numbers is defined like this to allow for separate
// specialization for long_long and int128_type, in case // specialization for long_long and int128_type, in case
// they conflict. // they conflict.