Make a nicer output when QBasicAtomicInteger is used with a wrong T
Before, we'd get just an error message that the size of the array was negative. Now, for C++11 compilers, we get a better error message: qbasicatomic.h:117:5: error: static assertion failed: Template parameter is not a supported integer on this platform qbasicatomic.h:119:24: error: invalid use of incomplete type ‘struct QAtomicOps<long long unsigned int>’ Change-Id: I6b0792254c0dc6103a4a7608f2942d59cda07c00 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
423ee63b7b
commit
1ca1cec64d
@ -133,7 +133,7 @@ class QBasicAtomicInteger
|
||||
public:
|
||||
typedef QAtomicOps<T> Ops;
|
||||
// static check that this is a valid integer
|
||||
typedef char PermittedIntegerType[QAtomicIntegerTraits<T>::IsInteger ? 1 : -1];
|
||||
Q_STATIC_ASSERT_X(QAtomicIntegerTraits<T>::IsInteger, "Template parameter is not a supported integer on this platform");
|
||||
|
||||
typename Ops::Type _q_value;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user