From a1e62e7ba14b00ac7c361936a18e7bc42bf1286d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Apr 2019 10:54:54 +0200 Subject: Replace Q_DECL_NOEXCEPT with noexcept in corelib In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira --- src/corelib/tools/qrefcount.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/corelib/tools/qrefcount.h') diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h index 9586c3a79a..71adb41f28 100644 --- a/src/corelib/tools/qrefcount.h +++ b/src/corelib/tools/qrefcount.h @@ -51,7 +51,7 @@ namespace QtPrivate class RefCount { public: - inline bool ref() Q_DECL_NOTHROW { + inline bool ref() noexcept { int count = atomic.load(); #if !defined(QT_NO_UNSHARABLE_CONTAINERS) if (count == 0) // !isSharable @@ -62,7 +62,7 @@ public: return true; } - inline bool deref() Q_DECL_NOTHROW { + inline bool deref() noexcept { int count = atomic.load(); #if !defined(QT_NO_UNSHARABLE_CONTAINERS) if (count == 0) // !isSharable @@ -74,7 +74,7 @@ public: } #if !defined(QT_NO_UNSHARABLE_CONTAINERS) - bool setSharable(bool sharable) Q_DECL_NOTHROW + bool setSharable(bool sharable) noexcept { Q_ASSERT(!isShared()); if (sharable) @@ -83,27 +83,27 @@ public: return atomic.testAndSetRelaxed(1, 0); } - bool isSharable() const Q_DECL_NOTHROW + bool isSharable() const noexcept { // Sharable === Shared ownership. return atomic.load() != 0; } #endif - bool isStatic() const Q_DECL_NOTHROW + bool isStatic() const noexcept { // Persistent object, never deleted return atomic.load() == -1; } - bool isShared() const Q_DECL_NOTHROW + bool isShared() const noexcept { int count = atomic.load(); return (count != 1) && (count != 0); } - void initializeOwned() Q_DECL_NOTHROW { atomic.store(1); } - void initializeUnsharable() Q_DECL_NOTHROW { atomic.store(0); } + void initializeOwned() noexcept { atomic.store(1); } + void initializeUnsharable() noexcept { atomic.store(0); } QBasicAtomicInt atomic; }; -- cgit v1.2.3