diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2015-01-08 15:08:22 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2015-01-10 08:43:15 +0100 |
commit | 390b16aea85e64bc33ce91e37898f59ad8a994c7 (patch) | |
tree | 0cefc9dd8f47cfca2af11e0337c26d22fc7af063 /src/corelib/kernel/qvariant.h | |
parent | 2c2801860dde4d707af9ce291489bee1750955d1 (diff) |
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/kernel/qvariant.h')
-rw-r--r-- | src/corelib/kernel/qvariant.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 7dce813bb5..7bee756fa5 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -253,13 +253,13 @@ class Q_CORE_EXPORT QVariant QVariant& operator=(const QVariant &other); #ifdef Q_COMPILER_RVALUE_REFS - inline QVariant(QVariant &&other) : d(other.d) + inline QVariant(QVariant &&other) Q_DECL_NOTHROW : d(other.d) { other.d = Private(); } - inline QVariant &operator=(QVariant &&other) + inline QVariant &operator=(QVariant &&other) Q_DECL_NOTHROW { qSwap(d, other.d); return *this; } #endif - inline void swap(QVariant &other) { qSwap(d, other.d); } + inline void swap(QVariant &other) Q_DECL_NOTHROW { qSwap(d, other.d); } Type type() const; int userType() const; @@ -360,15 +360,15 @@ class Q_CORE_EXPORT QVariant }; struct Private { - inline Private(): type(Invalid), is_shared(false), is_null(true) + inline Private() Q_DECL_NOTHROW : type(Invalid), is_shared(false), is_null(true) { data.ptr = 0; } // Internal constructor for initialized variants. - explicit inline Private(uint variantType) + explicit inline Private(uint variantType) Q_DECL_NOTHROW : type(variantType), is_shared(false), is_null(false) {} - inline Private(const Private &other) + inline Private(const Private &other) Q_DECL_NOTHROW : data(other.data), type(other.type), is_shared(other.is_shared), is_null(other.is_null) {} |