diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2013-04-12 16:08:41 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-15 17:45:20 +0200 |
commit | 8e127d9df868952d41c8aa622b6d4ead8139a835 (patch) | |
tree | db562e8f385151506194ff99978537f2c1c172bd /src/gui/kernel | |
parent | aa009e3dcc7ab47b27ec7e56a2b19fb835b04ee1 (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 <eike.ziller@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qopenglcontext.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qopenglcontext.h b/src/gui/kernel/qopenglcontext.h index 419fd541eb..bfdb8921af 100644 --- a/src/gui/kernel/qopenglcontext.h +++ b/src/gui/kernel/qopenglcontext.h @@ -101,7 +101,7 @@ private: QOpenGLVersionProfilePrivate* d; }; -inline uint qHash(const QOpenGLVersionProfile &v, uint seed) +inline uint qHash(const QOpenGLVersionProfile &v, uint seed = 0) { return qHash(static_cast<int>(v.profile() * 1000) + v.version().first * 100 + v.version().second * 10, seed); |