diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-08-06 18:03:49 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-18 18:35:36 +0200 |
commit | 2b00f97ab05f144293b26d1e0d8cf4c54d222f92 (patch) | |
tree | ef1ff7fa28fdb1449f5e91830adc26c36ef34c6c /src/corelib/arch/qatomic_cxx11.h | |
parent | 624911e48174094c80df7e27b28cc2b2d46f4398 (diff) |
Add Q_DECL_CONSTEXPR to the isXXX functions in the new atomics.
This allows one to write code that depends on these values at
compile-time.
Change-Id: I7d78524ed9c70d4141360496d1d764dcbfa92e62
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/arch/qatomic_cxx11.h')
-rw-r--r-- | src/corelib/arch/qatomic_cxx11.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h index 98e8e7043e..46b94e4029 100644 --- a/src/corelib/arch/qatomic_cxx11.h +++ b/src/corelib/arch/qatomic_cxx11.h @@ -144,8 +144,8 @@ template <typename T> struct QAtomicOps _q_value.store(newValue, std::memory_order_release); } - static inline bool isReferenceCountingNative() Q_DECL_NOTHROW { return true; } - static inline bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return false; } static inline bool ref(Type &_q_value) { return ++_q_value != 0; @@ -156,8 +156,8 @@ template <typename T> struct QAtomicOps return --_q_value != 0; } - static inline bool isTestAndSetNative() Q_DECL_NOTHROW { return false; } - static inline bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; } static bool testAndSetRelaxed(Type &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW @@ -180,8 +180,8 @@ template <typename T> struct QAtomicOps return _q_value.compare_exchange_strong(expectedValue, newValue, std::memory_order_acq_rel); } - static inline bool isFetchAndStoreNative() Q_DECL_NOTHROW { return false; } - static inline bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return false; } static T fetchAndStoreRelaxed(Type &_q_value, T newValue) Q_DECL_NOTHROW { @@ -203,8 +203,8 @@ template <typename T> struct QAtomicOps return _q_value.exchange(newValue, std::memory_order_acq_rel); } - static inline bool isFetchAndAddNative() Q_DECL_NOTHROW { return false; } - static inline bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; } static T fetchAndAddRelaxed(Type &_q_value, _AdditiveType valueToAdd) Q_DECL_NOTHROW |