summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Papp <lpapp@kde.org>2013-03-09 12:17:25 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-17 17:54:34 +0100
commit2025d02cf70eb8cea17b56c159ba4a5e6f83abf2 (patch)
treef04dd2ab80bc1d67aea90cc9916709a756f194bd
parentc82121fd7faa5812659d16260a061787177b848f (diff)
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 <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r--src/corelib/global/qtypetraits.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/global/qtypetraits.h b/src/corelib/global/qtypetraits.h
index 54b48667b4..692a982adf 100644
--- a/src/corelib/global/qtypetraits.h
+++ b/src/corelib/global/qtypetraits.h
@@ -246,6 +246,10 @@ template<> struct is_integral<unsigned long long> : true_type { };
template <class T> struct is_integral<const T> : is_integral<T> { };
template <class T> struct is_integral<volatile T> : is_integral<T> { };
template <class T> struct is_integral<const volatile T> : is_integral<T> { };
+#if defined (Q_COMPILER_UNICODE_STRINGS)
+template<> struct is_integral<char16_t> : true_type { };
+template<> struct is_integral<char32_t> : 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.