From 390b16aea85e64bc33ce91e37898f59ad8a994c7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 8 Jan 2015 15:08:22 +0100 Subject: QtCore: mark some operations nothrow This shotgun-surgery approach is motivated by trying to get a clean(er) build for -Wnoexcept on GCC, so it is expected that for any class touched here, there will be more operations that can be marked nothrow. But they don't show up in conditional noexcept clauses, yet, so they are deferred to some later commit. Change-Id: I0eb10d75a26c361fb22cf785399e83b434bdf233 Reviewed-by: Thiago Macieira --- src/corelib/tools/qhash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib/tools/qhash.h') diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 2a2c840c23..13006095e6 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -328,7 +328,7 @@ class QHash static inline int alignOfNode() { return qMax(sizeof(void*), Q_ALIGNOF(Node)); } public: - inline QHash() : d(const_cast(&QHashData::shared_null)) { } + inline QHash() Q_DECL_NOTHROW : d(const_cast(&QHashData::shared_null)) { } #ifdef Q_COMPILER_INITIALIZER_LISTS inline QHash(std::initializer_list > list) : d(const_cast(&QHashData::shared_null)) @@ -343,11 +343,11 @@ public: QHash &operator=(const QHash &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QHash(QHash &&other) : d(other.d) { other.d = const_cast(&QHashData::shared_null); } - inline QHash &operator=(QHash &&other) + inline QHash(QHash &&other) Q_DECL_NOTHROW : d(other.d) { other.d = const_cast(&QHashData::shared_null); } + inline QHash &operator=(QHash &&other) Q_DECL_NOTHROW { qSwap(d, other.d); return *this; } #endif - inline void swap(QHash &other) { qSwap(d, other.d); } + inline void swap(QHash &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QHash &other) const; inline bool operator!=(const QHash &other) const { return !(*this == other); } -- cgit v1.2.3