Add QtPrivate::QEnableIf
authorOlivier Goffart <olivier.goffart@nokia.com>
Thu, 19 May 2011 12:43:53 +0000 (14:43 +0200)
committerQt Continuous Integration System <qt-info@nokia.com>
Thu, 26 May 2011 12:16:20 +0000 (14:16 +0200)
Needed for QtConcurrent.

Like the new std::enable_if (in c++0x)

Reviewed-by: Joao
(cherry picked from commit 837f18f043b18410c1d93b9f1156acf729dad510)
Change-Id: I837f18f043b18410c1d93b9f1156acf729dad510
Reviewed-on: http://codereview.qt.nokia.com/141
Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
src/corelib/global/qglobal.h

index 3cc12aa..445b65b 100644 (file)
@@ -2790,6 +2790,12 @@ QT_LICENSED_MODULE(Sensors)
 #  define QT_NO_RAWFONT
 #endif
 
+namespace QtPrivate {
+//like std::enable_if
+template <bool B, typename T = void> struct QEnableIf;
+template <typename T> struct QEnableIf<true, T> { typedef T Type; };
+}
+
 QT_END_NAMESPACE
 QT_END_HEADER