summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl/qopenglversionfunctions.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <[email protected]>2013-04-12 16:08:41 +0200
committerThe Qt Project <[email protected]>2013-04-15 17:45:20 +0200
commit8e127d9df868952d41c8aa622b6d4ead8139a835 (patch)
treedb562e8f385151506194ff99978537f2c1c172bd /src/gui/opengl/qopenglversionfunctions.h
parentaa009e3dcc7ab47b27ec7e56a2b19fb835b04ee1 (diff)
Add default value for qHash's 'seed' argument for QOpenGLVersionProfile/Status
Although template<typename T> inline uint qHash(const T &t, uint seed) from qhash.h is never instantiated because we have the two-argument version of qHash() for both QOpenGLVersionProfile and QOpenGLVersionStatus, we need the default argument, as the template in qhash.h uses noexcept, which is evaluated regardless of instantiation, and uses qHash(t) without a seed. This behavior seems to not be the case with Apple clang 4.2, but has been observed with Apple clang 4.1, Clang 3.2, and GCC 4.8. Change-Id: If70e93f64eb9675a7c3ef7897ced2c6aebbec2d6 Reviewed-by: Eike Ziller <[email protected]> Reviewed-by: Olivier Goffart <[email protected]>
Diffstat (limited to 'src/gui/opengl/qopenglversionfunctions.h')
-rw-r--r--src/gui/opengl/qopenglversionfunctions.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/opengl/qopenglversionfunctions.h b/src/gui/opengl/qopenglversionfunctions.h
index 833c5adf9fa..304b944de8a 100644
--- a/src/gui/opengl/qopenglversionfunctions.h
+++ b/src/gui/opengl/qopenglversionfunctions.h
@@ -91,7 +91,7 @@ struct QOpenGLVersionStatus
OpenGLStatus status;
};
-inline uint qHash(const QOpenGLVersionStatus &v, uint seed)
+inline uint qHash(const QOpenGLVersionStatus &v, uint seed = 0)
{
return qHash(static_cast<int>(v.status * 1000)
+ v.version.first * 100 + v.version.second * 10, seed);