From 2025d02cf70eb8cea17b56c159ba4a5e6f83abf2 Mon Sep 17 00:00:00 2001 From: Laszlo Papp Date: Sat, 9 Mar 2013 12:17:25 +0000 Subject: [PATCH] Fix the is_enum type trait for char16/32_t (C++11) Add the char16/32_t types to the is_integral check with true for the type traits to pass the qglobal test for the is_enum functionality. Otherwise, those types will be detected as enums due to the internal test. These types are integral after all. Change-Id: I89ef6b6b4be348d8ef57b0d19ccea55b435e9b14 Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart --- src/corelib/global/qtypetraits.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h index 54b48667b4f..692a982adf6 100644 --- a/src/corelib/global/qtypetraits.h +++ b/src/corelib/global/qtypetraits.h @@ -246,6 +246,10 @@ template<> struct is_integral : true_type { }; template struct is_integral : is_integral { }; template struct is_integral : is_integral { }; template struct is_integral : is_integral { }; +#if defined (Q_COMPILER_UNICODE_STRINGS) +template<> struct is_integral : true_type { }; +template<> struct is_integral : true_type { }; +#endif // is_floating_point is false except for the built-in floating-point types. // A cv-qualified type is integral if and only if the underlying type is.