summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-02-04 16:39:44 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-14 00:34:25 +0100
commitd9440df5e9bbc76dbc7d5281c9176a6f26aa173d (patch)
tree9bcdeaa10f950ab5d12a1d420c711c287cde97c0 /src/corelib/global/qglobal.h
parent3c15118fa38aaec13125ff82f9cfeabfdd57fd21 (diff)
Centralize the handling of all the toXxx (integral) functions
By way of templates. This makes the code a lot cleaner. Change-Id: Ie369561c7631b0d34d76a6852883716cc0aa89d4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r--src/corelib/global/qglobal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 2a74801c42..0396fbc0c7 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1029,6 +1029,9 @@ namespace QtPrivate {
//like std::enable_if
template <bool B, typename T = void> struct QEnableIf;
template <typename T> struct QEnableIf<true, T> { typedef T Type; };
+
+template <bool B, typename T, typename F> struct QConditional { typedef T Type; };
+template <typename T, typename F> struct QConditional<false, T, F> { typedef F Type; };
}
#ifndef Q_FORWARD_DECLARE_OBJC_CLASS