diff options
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qcommandlineoption.h | 5 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.h | 5 | ||||
-rw-r--r-- | src/corelib/tools/qvector.h | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/corelib/tools/qcommandlineoption.h b/src/corelib/tools/qcommandlineoption.h index 85fc5ca6dd..828522cbc5 100644 --- a/src/corelib/tools/qcommandlineoption.h +++ b/src/corelib/tools/qcommandlineoption.h @@ -58,11 +58,10 @@ public: QCommandLineOption &operator=(const QCommandLineOption &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QCommandLineOption &operator=(QCommandLineOption &&other) - { qSwap(d, other.d); return *this; } + QCommandLineOption &operator=(QCommandLineOption &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif - inline void swap(QCommandLineOption &other) + void swap(QCommandLineOption &other) Q_DECL_NOTHROW { qSwap(d, other.d); } QStringList names() const; diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index 78ec2b156a..273778f48c 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -222,9 +222,12 @@ public: QDateTime(const QDateTime &other); ~QDateTime(); +#ifdef Q_COMPILER_RVALUE_REFS + QDateTime &operator=(QDateTime &&other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QDateTime &operator=(const QDateTime &other); - inline void swap(QDateTime &other) { qSwap(d, other.d); } + void swap(QDateTime &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool isNull() const; bool isValid() const; diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index d13ae9dccd..821fc9b68a 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -69,11 +69,10 @@ public: inline ~QVector() { if (!d->ref.deref()) freeData(d); } QVector<T> &operator=(const QVector<T> &v); #ifdef Q_COMPILER_RVALUE_REFS - inline QVector(QVector<T> &&other) : d(other.d) { other.d = Data::sharedNull(); } - inline QVector<T> operator=(QVector<T> &&other) - { qSwap(d, other.d); return *this; } + QVector(QVector<T> &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Data::sharedNull(); } + QVector<T> operator=(QVector<T> &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif - inline void swap(QVector<T> &other) { qSwap(d, other.d); } + void swap(QVector<T> &other) Q_DECL_NOTHROW { qSwap(d, other.d); } #ifdef Q_COMPILER_INITIALIZER_LISTS inline QVector(std::initializer_list<T> args); #endif |