From 449c859c9dc6a4b0a2a9e7a459e52f69d76d62d0 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 12 Jul 2013 18:28:17 +0000 Subject: [PATCH] Add support for char16_t and char32_t. Fixes #8780. [SVN r85019] --- include/boost/type_traits/is_integral.hpp | 6 ++++++ test/is_arithmetic_test.cpp | 7 +++++++ test/is_fundamental_test.cpp | 7 +++++++ test/is_integral_test.cpp | 14 +++++++------- test/is_pod_test.cpp | 7 +++++++ test/is_scalar_test.cpp | 7 +++++++ 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/include/boost/type_traits/is_integral.hpp b/include/boost/type_traits/is_integral.hpp index 4ca9734..1ab27fd 100644 --- a/include/boost/type_traits/is_integral.hpp +++ b/include/boost/type_traits/is_integral.hpp @@ -73,6 +73,12 @@ BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,__int64,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::int128_type,true) BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,boost::uint128_type,true) #endif +#ifndef BOOST_NO_CXX11_CHAR16_T +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char16_t,true) +#endif +#ifndef BOOST_NO_CXX11_CHAR32_T +BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral,char32_t,true) +#endif #endif // non-CodeGear implementation diff --git a/test/is_arithmetic_test.cpp b/test/is_arithmetic_test.cpp index 68b5e73..41226d3 100644 --- a/test/is_arithmetic_test.cpp +++ b/test/is_arithmetic_test.cpp @@ -144,6 +144,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, false); +#ifndef BOOST_NO_CXX11_CHAR16_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif +#ifndef BOOST_NO_CXX11_CHAR32_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic::value, true); +#endif + TT_TEST_END diff --git a/test/is_fundamental_test.cpp b/test/is_fundamental_test.cpp index ca2a6b8..a9dce34 100644 --- a/test/is_fundamental_test.cpp +++ b/test/is_fundamental_test.cpp @@ -148,6 +148,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, false); +#ifndef BOOST_NO_CXX11_CHAR16_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif +#ifndef BOOST_NO_CXX11_CHAR32_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental::value, true); +#endif + TT_TEST_END diff --git a/test/is_integral_test.cpp b/test/is_integral_test.cpp index c466c9b..3eff19a 100644 --- a/test/is_integral_test.cpp +++ b/test/is_integral_test.cpp @@ -147,12 +147,12 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, false); +#ifndef BOOST_NO_CXX11_CHAR16_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +#endif +#ifndef BOOST_NO_CXX11_CHAR32_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral::value, true); +#endif + TT_TEST_END - - - - - - - diff --git a/test/is_pod_test.cpp b/test/is_pod_test.cpp index 1fca2d5..4f17741 100644 --- a/test/is_pod_test.cpp +++ b/test/is_pod_test.cpp @@ -170,6 +170,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod >::value, false); +#ifndef BOOST_NO_CXX11_CHAR16_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif +#ifndef BOOST_NO_CXX11_CHAR32_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod::value, true); +#endif + TT_TEST_END diff --git a/test/is_scalar_test.cpp b/test/is_scalar_test.cpp index 116db1f..8b22363 100644 --- a/test/is_scalar_test.cpp +++ b/test/is_scalar_test.cpp @@ -149,6 +149,13 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); #endif BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, false); +#ifndef BOOST_NO_CXX11_CHAR16_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif +#ifndef BOOST_NO_CXX11_CHAR32_T +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar::value, true); +#endif + TT_TEST_END