diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-08 16:46:26 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-06-09 00:41:30 +0200 |
commit | c55f45e875ece0624f549b0ead9d72803434931a (patch) | |
tree | 3168797ae309709be81ee00b8b9353b4576788bd /src | |
parent | 8edf11d51059b2ecb42dbf45f037d88e5b2beab6 (diff) |
QArrayData: stop using std::is_literal_type
The trait is deprecated in C++17 and removed in C++20. Enforce
the same meaning by using a constexpr variable instead.
Change-Id: Ief13afc3f889af09094391e626037778d879c4f5
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/tools/qarraydata.h | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index d996b9c56b..b6fc05e108 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -288,20 +288,12 @@ struct QTypedArrayData }()) \ /**/ -#ifdef Q_COMPILER_CONSTEXPR -#define Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type) Q_STATIC_ASSERT(std::is_literal_type<Type>::value) -#else -#define Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type) do {} while (0) -#endif - #define Q_ARRAY_LITERAL_IMPL(Type, ...) \ - Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type); \ - \ /* Portable compile-time array size computation */ \ - static Type const data[] = { __VA_ARGS__ }; \ + static constexpr Type data[] = { __VA_ARGS__ }; \ enum { Size = sizeof(data) / sizeof(data[0]) }; \ \ - static const QArrayData literal = { Q_BASIC_ATOMIC_INITIALIZER(-1), QArrayData::StaticDataFlags, 0 }; \ + static constexpr QArrayData literal = { Q_BASIC_ATOMIC_INITIALIZER(-1), QArrayData::StaticDataFlags, 0 };\ \ QArrayDataPointerRef<Type> ref = \ { static_cast<QTypedArrayData<Type> *>( \ |