From e445f3c47bea3e2d3dffa1215b24cb90dccd8c73 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 21 Apr 2015 16:25:25 +0200 Subject: Add noexcept to move constructors and assignment operators Add the noexcept attribute to all move constructors and assignment operators in QtGui that didn't already have it. Change-Id: Idcdf79ae8349b8793e7394b5ae7c08e6111fbc9a Reviewed-by: Konstantin Ritt Reviewed-by: Gunnar Sletta --- src/gui/kernel/qpalette.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/gui/kernel/qpalette.h') diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h index e8b35aa82a..78dd2ce9d7 100644 --- a/src/gui/kernel/qpalette.h +++ b/src/gui/kernel/qpalette.h @@ -61,16 +61,18 @@ public: ~QPalette(); QPalette &operator=(const QPalette &palette); #ifdef Q_COMPILER_RVALUE_REFS - QPalette(QPalette &&other) Q_DECL_NOTHROW - : d(other.d), data(other.data) { other.d = Q_NULLPTR; } - inline QPalette &operator=(QPalette &&other) + QPalette(QPalette &&other) Q_DECL_NOEXCEPT + : d(other.d), data(other.data) + { other.d = Q_NULLPTR; } + inline QPalette &operator=(QPalette &&other) Q_DECL_NOEXCEPT { for_faster_swapping_dont_use = other.for_faster_swapping_dont_use; qSwap(d, other.d); return *this; } #endif - void swap(QPalette &other) { + void swap(QPalette &other) Q_DECL_NOEXCEPT + { qSwap(d, other.d); qSwap(for_faster_swapping_dont_use, other.for_faster_swapping_dont_use); } -- cgit v1.2.3