path: root/src/corelib/tools/qdatetime.h
diff options
authorThiago Macieira <>2012-08-02 15:51:52 +0200
committerQt by Nokia <>2012-08-20 21:59:21 +0200
commit373845dfd8acae0c941432c8cd615b77bcae0a2a (patch)
treed8d88bdd6657a18f55456bfe2ac5dfff682e76aa /src/corelib/tools/qdatetime.h
parent291938aea6771a0ce4c11a164583a73c6eef026e (diff)
Add Q_DECL_NOTHROW to some qHash functions
The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo <> Reviewed-by: Marc Mutz <> Reviewed-by: Thiago Macieira <>
Diffstat (limited to 'src/corelib/tools/qdatetime.h')
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index aa7082b4e1..13c7ed0979 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -288,9 +288,11 @@ Q_CORE_EXPORT QDebug operator<<(QDebug, const QTime &);
Q_CORE_EXPORT QDebug operator<<(QDebug, const QDateTime &);
+// QDateTime is not noexcept for now -- to be revised once
+// timezone and calendaring support is added
Q_CORE_EXPORT uint qHash(const QDateTime &key, uint seed = 0);
-Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0);
-Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0);
+Q_CORE_EXPORT uint qHash(const QDate &key, uint seed = 0) Q_DECL_NOTHROW;
+Q_CORE_EXPORT uint qHash(const QTime &key, uint seed = 0) Q_DECL_NOTHROW;