diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-08-12 14:14:02 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-08-14 15:52:58 +0200 |
commit | 6f0df02d002356625f10683ef84da7685d92a2c4 (patch) | |
tree | 46713209af459ebda534c3404f48c5f5c80ba3f8 /src/corelib/thread/qgenericatomic.h | |
parent | 44cce1a2ea9dadd8b2de93f40de34269dda703c0 (diff) |
Replace Qt CONSTEXPR defines with constexpr
Both normal and relaxed constexpr are required by our new minimum of
C++17.
Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread/qgenericatomic.h')
-rw-r--r-- | src/corelib/thread/qgenericatomic.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h index e9e5f3c74b..0fa9a9a418 100644 --- a/src/corelib/thread/qgenericatomic.h +++ b/src/corelib/thread/qgenericatomic.h @@ -123,9 +123,9 @@ template <typename BaseClass> struct QGenericAtomicOps *static_cast<volatile T *>(&_q_value) = newValue; } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() noexcept + static inline constexpr bool isReferenceCountingNative() noexcept { return BaseClass::isFetchAndAddNative(); } - static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() noexcept + static inline constexpr bool isReferenceCountingWaitFree() noexcept { return BaseClass::isFetchAndAddWaitFree(); } template <typename T> static Q_ALWAYS_INLINE bool ref(T &_q_value) noexcept @@ -142,8 +142,8 @@ template <typename BaseClass> struct QGenericAtomicOps #if 0 // These functions have no default implementation // Archictectures must implement them - static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() noexcept; - static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() noexcept; + static inline constexpr bool isTestAndSetNative() noexcept; + static inline constexpr bool isTestAndSetWaitFree() noexcept; template <typename T, typename X> static inline bool testAndSetRelaxed(T &_q_value, X expectedValue, X newValue) noexcept; template <typename T, typename X> static inline @@ -194,8 +194,8 @@ template <typename BaseClass> struct QGenericAtomicOps return BaseClass::testAndSetRelaxed(_q_value, expectedValue, newValue, currentValue); } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() noexcept { return false; } - static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() noexcept { return false; } + static inline constexpr bool isFetchAndStoreNative() noexcept { return false; } + static inline constexpr bool isFetchAndStoreWaitFree() noexcept { return false; } template <typename T, typename X> static Q_ALWAYS_INLINE T fetchAndStoreRelaxed(T &_q_value, X newValue) noexcept @@ -230,8 +230,8 @@ template <typename BaseClass> struct QGenericAtomicOps return BaseClass::fetchAndStoreRelaxed(_q_value, newValue); } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() noexcept { return false; } - static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() noexcept { return false; } + static inline constexpr bool isFetchAndAddNative() noexcept { return false; } + static inline constexpr bool isFetchAndAddWaitFree() noexcept { return false; } template <typename T> static Q_ALWAYS_INLINE T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) noexcept { |