diff options
author | Ivan Tkachenko <me@ratijas.tk> | 2021-08-17 15:21:19 +0300 |
---|---|---|
committer | Ivan Tkachenko <me@ratijas.tk> | 2021-08-24 17:19:50 +0300 |
commit | e38980b7271718932a54e53987ac0a9551a11511 (patch) | |
tree | 13525ec796cd27ed8c676458b437fe7babfa2d5f /src/qml | |
parent | 095524dd31aef56d804e89afd74a881e8575ef20 (diff) |
Upgrade std::is_trivial::value to C++17 std::is_trivial_v
Since Qt 6 requires at least C++17, we can finally make use of some of
its goodness.
Change-Id: I56a318bc0b1b60d1e2b0186f335f8feda7622df4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/common/qv4staticvalue_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4arraydata_p.h | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4context_p.h | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4managed_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4memberdata_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4regexp_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4string_p.h | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 2 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4vtable_p.h | 2 | ||||
-rw-r--r-- | src/qml/memory/qv4heap_p.h | 6 | ||||
-rw-r--r-- | src/qml/memory/qv4mm_p.h | 2 |
11 files changed, 16 insertions, 16 deletions
diff --git a/src/qml/common/qv4staticvalue_p.h b/src/qml/common/qv4staticvalue_p.h index 5c2cdcf56e..a23cdf7428 100644 --- a/src/qml/common/qv4staticvalue_p.h +++ b/src/qml/common/qv4staticvalue_p.h @@ -453,7 +453,7 @@ struct StaticValue return static_cast<uint>(toInt32(d)); } }; -Q_STATIC_ASSERT(std::is_trivial<StaticValue>::value); +Q_STATIC_ASSERT(std::is_trivial_v<StaticValue>); struct Encode { static constexpr ReturnedValue undefined() { diff --git a/src/qml/jsruntime/qv4arraydata_p.h b/src/qml/jsruntime/qv4arraydata_p.h index 64b2161ef5..b1d3022eed 100644 --- a/src/qml/jsruntime/qv4arraydata_p.h +++ b/src/qml/jsruntime/qv4arraydata_p.h @@ -129,7 +129,7 @@ DECLARE_HEAP_OBJECT(ArrayData, Base) { uint mappedIndex(uint index) const; }; -Q_STATIC_ASSERT(std::is_trivial< ArrayData >::value); +Q_STATIC_ASSERT(std::is_trivial_v<ArrayData>); struct SimpleArrayData : public ArrayData { uint mappedIndex(uint index) const { index += offset; if (index >= values.alloc) index -= values.alloc; return index; } @@ -142,7 +142,7 @@ struct SimpleArrayData : public ArrayData { return attrs ? attrs[i] : Attr_Data; } }; -Q_STATIC_ASSERT(std::is_trivial< SimpleArrayData >::value); +Q_STATIC_ASSERT(std::is_trivial_v<SimpleArrayData>); struct SparseArrayData : public ArrayData { void destroy() { diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index cc27d20fd4..8c9dc075fb 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -92,7 +92,7 @@ DECLARE_HEAP_OBJECT(ExecutionContext, Base) { quint8 padding_[4]; #endif }; -Q_STATIC_ASSERT(std::is_trivial< ExecutionContext >::value); +Q_STATIC_ASSERT(std::is_trivial_v<ExecutionContext>); Q_STATIC_ASSERT(sizeof(ExecutionContext) == sizeof(Base) + sizeof(ExecutionContextData) + QT_POINTER_SIZE); Q_STATIC_ASSERT(std::is_standard_layout<ExecutionContextData>::value); @@ -125,7 +125,7 @@ DECLARE_HEAP_OBJECT(CallContext, ExecutionContext) { locals.values[i] = Value::emptyValue(); } }; -Q_STATIC_ASSERT(std::is_trivial< CallContext >::value); +Q_STATIC_ASSERT(std::is_trivial_v<CallContext>); Q_STATIC_ASSERT(std::is_standard_layout<CallContextData>::value); Q_STATIC_ASSERT(offsetof(CallContextData, function) == 0); //### The following size check fails on Win8. With the ValueArray at the end of the diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index 016b3e2eea..caa7a9b4e8 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -95,7 +95,7 @@ inline void qYouForgotTheQ_MANAGED_Macro(T1, T2) {} DataClass() = delete; \ Q_DISABLE_COPY(DataClass) \ V4_MANAGED_ITSELF(DataClass, superClass) \ - Q_STATIC_ASSERT(std::is_trivial< QV4::Heap::DataClass >::value); + Q_STATIC_ASSERT(std::is_trivial_v<QV4::Heap::DataClass>); #define Q_MANAGED_TYPE(type) \ public: \ diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h index 186083b83a..2f3de0a051 100644 --- a/src/qml/jsruntime/qv4memberdata_p.h +++ b/src/qml/jsruntime/qv4memberdata_p.h @@ -65,7 +65,7 @@ namespace Heap { DECLARE_HEAP_OBJECT(MemberData, Base) { DECLARE_MARKOBJECTS(MemberData); }; -Q_STATIC_ASSERT(std::is_trivial< MemberData >::value); +Q_STATIC_ASSERT(std::is_trivial_v<MemberData>); } diff --git a/src/qml/jsruntime/qv4regexp_p.h b/src/qml/jsruntime/qv4regexp_p.h index 122db47008..c2d6ae646a 100644 --- a/src/qml/jsruntime/qv4regexp_p.h +++ b/src/qml/jsruntime/qv4regexp_p.h @@ -106,7 +106,7 @@ struct RegExp : Base { QString flagsAsString() const; int captureCount() const { return subPatternCount + 1; } }; -Q_STATIC_ASSERT(std::is_trivial< RegExp >::value); +Q_STATIC_ASSERT(std::is_trivial_v<RegExp>); } diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index d5d11ef660..5720b09fe3 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -149,7 +149,7 @@ struct Q_QML_PRIVATE_EXPORT String : StringOrSymbol { private: static void append(const String *data, QChar *ch); }; -Q_STATIC_ASSERT(std::is_trivial< String >::value); +Q_STATIC_ASSERT(std::is_trivial_v<String>); struct ComplexString : String { void init(String *l, String *n); @@ -162,7 +162,7 @@ struct ComplexString : String { }; int len; }; -Q_STATIC_ASSERT(std::is_trivial< ComplexString >::value); +Q_STATIC_ASSERT(std::is_trivial_v<ComplexString>); inline int String::length() const { diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 6941c11f44..50c80eb9de 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -311,7 +311,7 @@ struct Q_QML_PRIVATE_EXPORT Value : public StaticValue template<typename T> Value &operator=(const Scoped<T> &t); }; -Q_STATIC_ASSERT(std::is_trivial<Value>::value); +Q_STATIC_ASSERT(std::is_trivial_v<Value>); Q_STATIC_ASSERT(sizeof(Value) == sizeof(StaticValue)); template<> diff --git a/src/qml/jsruntime/qv4vtable_p.h b/src/qml/jsruntime/qv4vtable_p.h index ba44baae1a..e66fb4cde6 100644 --- a/src/qml/jsruntime/qv4vtable_p.h +++ b/src/qml/jsruntime/qv4vtable_p.h @@ -279,7 +279,7 @@ const QV4::VTable classname::static_vtbl = DEFINE_MANAGED_VTABLE_INT(classname, dptr->_checkIsInitialized(); \ return dptr; \ } \ - Q_STATIC_ASSERT(std::is_trivial< QV4::Heap::DataClass >::value); + Q_STATIC_ASSERT(std::is_trivial_v<QV4::Heap::DataClass>); #define V4_PROTOTYPE(p) \ static QV4::Object *defaultPrototype(QV4::ExecutionEngine *e) \ diff --git a/src/qml/memory/qv4heap_p.h b/src/qml/memory/qv4heap_p.h index 5fb14332ab..6556fcd2e4 100644 --- a/src/qml/memory/qv4heap_p.h +++ b/src/qml/memory/qv4heap_p.h @@ -89,7 +89,7 @@ private: Base *ptr; }; typedef Pointer<char *, 0> V4PointerCheck; -Q_STATIC_ASSERT(std::is_trivial< V4PointerCheck >::value); +Q_STATIC_ASSERT(std::is_trivial_v<V4PointerCheck>); struct Q_QML_EXPORT Base { void *operator new(size_t) = delete; @@ -168,7 +168,7 @@ struct Q_QML_EXPORT Base { Q_ALWAYS_INLINE void _setDestroyed() {} #endif }; -Q_STATIC_ASSERT(std::is_trivial< Base >::value); +Q_STATIC_ASSERT(std::is_trivial_v<Base>); // This class needs to consist only of pointer sized members to allow // for a size/offset translation when cross-compiling between 32- and // 64-bit. @@ -253,7 +253,7 @@ private: QtSharedPointer::ExternalRefCountData *d; QObject *qObject; }; -Q_STATIC_ASSERT(std::is_trivial< QV4QPointer<QObject> >::value); +Q_STATIC_ASSERT(std::is_trivial_v<QV4QPointer<QObject>>); #endif } diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index 881f4fd19d..f87c6e4075 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -162,7 +162,7 @@ public: template<typename ManagedType> inline typename ManagedType::Data *allocManaged(std::size_t size, Heap::InternalClass *ic) { - Q_STATIC_ASSERT(std::is_trivial< typename ManagedType::Data >::value); + Q_STATIC_ASSERT(std::is_trivial_v<typename ManagedType::Data>); size = align(size); typename ManagedType::Data *d = static_cast<typename ManagedType::Data *>(allocData(size)); d->internalClass.set(engine, ic); |