Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85019 - in trunk: boost/type_traits libs/type_traits/test
From: john_at_[hidden]
Date: 2013-07-12 14:28:17


Author: johnmaddock
Date: 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013)
New Revision: 85019
URL: http://svn.boost.org/trac/boost/changeset/85019

Log:
Add support for char16_t and char32_t.
Fixes #8780.

Text files modified:
   trunk/boost/type_traits/is_integral.hpp | 6 ++++++
   trunk/libs/type_traits/test/is_arithmetic_test.cpp | 7 +++++++
   trunk/libs/type_traits/test/is_fundamental_test.cpp | 7 +++++++
   trunk/libs/type_traits/test/is_integral_test.cpp | 14 +++++++-------
   trunk/libs/type_traits/test/is_pod_test.cpp | 7 +++++++
   trunk/libs/type_traits/test/is_scalar_test.cpp | 7 +++++++
   6 files changed, 41 insertions(+), 7 deletions(-)

Modified: trunk/boost/type_traits/is_integral.hpp
==============================================================================
--- trunk/boost/type_traits/is_integral.hpp Fri Jul 12 14:21:50 2013 (r85018)
+++ trunk/boost/type_traits/is_integral.hpp 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013) (r85019)
@@ -73,6 +73,12 @@
 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
 

Modified: trunk/libs/type_traits/test/is_arithmetic_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_arithmetic_test.cpp Fri Jul 12 14:21:50 2013 (r85018)
+++ trunk/libs/type_traits/test/is_arithmetic_test.cpp 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013) (r85019)
@@ -144,6 +144,13 @@
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<foo0_t>::value, false);
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<incomplete_type>::value, false);
 
+#ifndef BOOST_NO_CXX11_CHAR16_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<char16_t>::value, true);
+#endif
+#ifndef BOOST_NO_CXX11_CHAR32_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_arithmetic<char32_t>::value, true);
+#endif
+
 TT_TEST_END
 
 

Modified: trunk/libs/type_traits/test/is_fundamental_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_fundamental_test.cpp Fri Jul 12 14:21:50 2013 (r85018)
+++ trunk/libs/type_traits/test/is_fundamental_test.cpp 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013) (r85019)
@@ -148,6 +148,13 @@
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<incomplete_type>::value, false);
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<foo0_t>::value, false);
 
+#ifndef BOOST_NO_CXX11_CHAR16_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<char16_t>::value, true);
+#endif
+#ifndef BOOST_NO_CXX11_CHAR32_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_fundamental<char32_t>::value, true);
+#endif
+
 TT_TEST_END
 
 

Modified: trunk/libs/type_traits/test/is_integral_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_integral_test.cpp Fri Jul 12 14:21:50 2013 (r85018)
+++ trunk/libs/type_traits/test/is_integral_test.cpp 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013) (r85019)
@@ -147,12 +147,12 @@
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<foo4_t>::value, false);
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<incomplete_type>::value, false);
 
-TT_TEST_END
-
-
-
-
-
-
+#ifndef BOOST_NO_CXX11_CHAR16_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char16_t>::value, true);
+#endif
+#ifndef BOOST_NO_CXX11_CHAR32_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_integral<char32_t>::value, true);
+#endif
 
+TT_TEST_END
 

Modified: trunk/libs/type_traits/test/is_pod_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_pod_test.cpp Fri Jul 12 14:21:50 2013 (r85018)
+++ trunk/libs/type_traits/test/is_pod_test.cpp 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013) (r85019)
@@ -170,6 +170,13 @@
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<wrap<trivial_except_destroy> >::value, false);
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<wrap<trivial_except_construct> >::value, false);
 
+#ifndef BOOST_NO_CXX11_CHAR16_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<char16_t>::value, true);
+#endif
+#ifndef BOOST_NO_CXX11_CHAR32_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_pod<char32_t>::value, true);
+#endif
+
 TT_TEST_END
 
 

Modified: trunk/libs/type_traits/test/is_scalar_test.cpp
==============================================================================
--- trunk/libs/type_traits/test/is_scalar_test.cpp Fri Jul 12 14:21:50 2013 (r85018)
+++ trunk/libs/type_traits/test/is_scalar_test.cpp 2013-07-12 14:28:17 EDT (Fri, 12 Jul 2013) (r85019)
@@ -149,6 +149,13 @@
 #endif
 BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<test_abc1>::value, false);
 
+#ifndef BOOST_NO_CXX11_CHAR16_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<char16_t>::value, true);
+#endif
+#ifndef BOOST_NO_CXX11_CHAR32_T
+BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_scalar<char32_t>::value, true);
+#endif
+
 TT_TEST_END
 
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk