From f815676b7d46cfe6e79985dee9fce182edb346d7 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 25 Jun 2015 18:41:14 +0200 Subject: QtCore: make all Q_DECLARE_SHARED types nothrow move-assignable Excepting QDebug, which doesn't have value semantics. Change-Id: I43757ef7bba4c1f5b6de9144f12b38ce840cd9f9 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/io/qdir.h | 5 ++--- src/corelib/io/qfileinfo.h | 5 ++--- src/corelib/io/qprocess.h | 5 ++++- src/corelib/io/qstorageinfo.h | 5 ++--- src/corelib/io/qurlquery.h | 5 ++--- 5 files changed, 12 insertions(+), 13 deletions(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qdir.h b/src/corelib/io/qdir.h index b6946eba65..ab3a331229 100644 --- a/src/corelib/io/qdir.h +++ b/src/corelib/io/qdir.h @@ -101,11 +101,10 @@ public: QDir &operator=(const QDir &); QDir &operator=(const QString &path); #ifdef Q_COMPILER_RVALUE_REFS - inline QDir &operator=(QDir &&other) - { qSwap(d_ptr, other.d_ptr); return *this; } + QDir &operator=(QDir &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif - inline void swap(QDir &other) + void swap(QDir &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); } void setPath(const QString &path); diff --git a/src/corelib/io/qfileinfo.h b/src/corelib/io/qfileinfo.h index 58cf9a5c0f..59d12c3883 100644 --- a/src/corelib/io/qfileinfo.h +++ b/src/corelib/io/qfileinfo.h @@ -62,11 +62,10 @@ public: QFileInfo &operator=(const QFileInfo &fileinfo); #ifdef Q_COMPILER_RVALUE_REFS - inline QFileInfo&operator=(QFileInfo &&other) - { qSwap(d_ptr, other.d_ptr); return *this; } + QFileInfo &operator=(QFileInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif - inline void swap(QFileInfo &other) + void swap(QFileInfo &other) Q_DECL_NOTHROW { qSwap(d_ptr, other.d_ptr); } bool operator==(const QFileInfo &fileinfo) const; diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index 32fa4aa866..df9fa886c1 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -60,9 +60,12 @@ public: QProcessEnvironment(); QProcessEnvironment(const QProcessEnvironment &other); ~QProcessEnvironment(); +#ifdef Q_COMPILER_RVALUE_REFS + QProcessEnvironment &operator=(QProcessEnvironment && other) Q_DECL_NOTHROW { swap(other); return *this; } +#endif QProcessEnvironment &operator=(const QProcessEnvironment &other); - inline void swap(QProcessEnvironment &other) { qSwap(d, other.d); } + void swap(QProcessEnvironment &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool operator==(const QProcessEnvironment &other) const; inline bool operator!=(const QProcessEnvironment &other) const diff --git a/src/corelib/io/qstorageinfo.h b/src/corelib/io/qstorageinfo.h index 848278e69f..b9d694cb14 100644 --- a/src/corelib/io/qstorageinfo.h +++ b/src/corelib/io/qstorageinfo.h @@ -55,11 +55,10 @@ public: QStorageInfo &operator=(const QStorageInfo &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QStorageInfo &operator=(QStorageInfo &&other) - { qSwap(d, other.d); return *this; } + QStorageInfo &operator=(QStorageInfo &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif - inline void swap(QStorageInfo &other) + inline void swap(QStorageInfo &other) Q_DECL_NOTHROW { qSwap(d, other.d); } void setPath(const QString &path); diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h index 21962fcb22..ae3a79c119 100644 --- a/src/corelib/io/qurlquery.h +++ b/src/corelib/io/qurlquery.h @@ -56,8 +56,7 @@ public: QUrlQuery(const QUrlQuery &other); QUrlQuery &operator=(const QUrlQuery &other); #ifdef Q_COMPILER_RVALUE_REFS - QUrlQuery &operator=(QUrlQuery &&other) - { qSwap(d, other.d); return *this; } + QUrlQuery &operator=(QUrlQuery &&other) Q_DECL_NOTHROW { swap(other); return *this; } #endif ~QUrlQuery(); @@ -65,7 +64,7 @@ public: bool operator!=(const QUrlQuery &other) const { return !(*this == other); } - void swap(QUrlQuery &other) { qSwap(d, other.d); } + void swap(QUrlQuery &other) Q_DECL_NOTHROW { qSwap(d, other.d); } bool isEmpty() const; bool isDetached() const; -- cgit v1.2.3