summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-08-20 18:31:06 +0200
committerLars Knoll <lars.knoll@qt.io>2020-08-26 01:03:22 +0200
commitacbf9a858b6b389103b7f43f4f4892a142ec56c6 (patch)
tree1c5e7feae0cd6999e37fca0644d152c76d29a790 /src/corelib/tools
parentdb21bad936a761f475145886f1e06dfcfa11eb80 (diff)
Cleanup QTypeInfo
Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6. Also remove sizeOf, it's unused, and we have QMetaType for that if required. Remove all typeinfo declaractions for trivial types, as the default template covers them correctly nowadays. Finally set up a better default for isPointer, and do some smaller cleanups all over the place. Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qarraydataops.h8
-rw-r--r--src/corelib/tools/qcontainertools_impl.h4
-rw-r--r--src/corelib/tools/qvarlengtharray.h4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qarraydataops.h b/src/corelib/tools/qarraydataops.h
index f787dacfac..f6384ca998 100644
--- a/src/corelib/tools/qarraydataops.h
+++ b/src/corelib/tools/qarraydataops.h
@@ -174,7 +174,7 @@ struct QArrayExceptionSafetyPrimitives
T *const end;
qsizetype displace;
- static_assert(QTypeInfoQuery<T>::isRelocatable, "Type must be relocatable");
+ static_assert(QTypeInfo<T>::isRelocatable, "Type must be relocatable");
Displacer(T *start, T *finish, qsizetype diff) noexcept
: begin(start), end(finish), displace(diff)
@@ -201,7 +201,7 @@ struct QArrayExceptionSafetyPrimitives
size_t n;
qsizetype &size;
- static_assert(QTypeInfoQuery<T>::isRelocatable, "Type must be relocatable");
+ static_assert(QTypeInfo<T>::isRelocatable, "Type must be relocatable");
Mover(T *&start, size_t length, qsizetype &sz) noexcept
: destination(start), source(start), n(length), size(sz)
@@ -1018,7 +1018,7 @@ struct QArrayOpsSelector
template <class T>
struct QArrayOpsSelector<T,
typename std::enable_if<
- !QTypeInfoQuery<T>::isComplex && QTypeInfoQuery<T>::isRelocatable
+ !QTypeInfo<T>::isComplex && QTypeInfo<T>::isRelocatable
>::type>
{
typedef QPodArrayOps<T> Type;
@@ -1027,7 +1027,7 @@ struct QArrayOpsSelector<T,
template <class T>
struct QArrayOpsSelector<T,
typename std::enable_if<
- QTypeInfoQuery<T>::isComplex && QTypeInfoQuery<T>::isRelocatable
+ QTypeInfo<T>::isComplex && QTypeInfo<T>::isRelocatable
>::type>
{
typedef QMovableArrayOps<T> Type;
diff --git a/src/corelib/tools/qcontainertools_impl.h b/src/corelib/tools/qcontainertools_impl.h
index 44cfdc444e..a7e1aa31cd 100644
--- a/src/corelib/tools/qcontainertools_impl.h
+++ b/src/corelib/tools/qcontainertools_impl.h
@@ -61,7 +61,7 @@ namespace QtPrivate
template <typename T, typename N>
void q_uninitialized_relocate_n(T* first, N n, T* out)
{
- if constexpr (QTypeInfoQuery<T>::isRelocatable) {
+ if constexpr (QTypeInfo<T>::isRelocatable) {
if (n != N(0)) { // even if N == 0, out == nullptr or first == nullptr are UB for memmove()
std::memmove(static_cast<void*>(out),
static_cast<const void*>(first),
@@ -69,7 +69,7 @@ void q_uninitialized_relocate_n(T* first, N n, T* out)
}
} else {
std::uninitialized_move_n(first, n, out);
- if constexpr (QTypeInfoQuery<T>::isComplex)
+ if constexpr (QTypeInfo<T>::isComplex)
std::destroy_n(first, n);
}
}
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index a70fc75fcf..01571e3e9f 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -429,7 +429,7 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(qsizetype asize,
a = Prealloc;
}
s = 0;
- if (!QTypeInfoQuery<T>::isRelocatable) {
+ if (!QTypeInfo<T>::isRelocatable) {
QT_TRY {
// move all the old elements
while (s < copySize) {
@@ -556,7 +556,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray<T, Prealloc>::iterator QVarLengthA
if (n != 0) {
resize(s + n);
const T copy(t);
- if (!QTypeInfoQuery<T>::isRelocatable) {
+ if (!QTypeInfo<T>::isRelocatable) {
T *b = ptr + offset;
T *j = ptr + s;
T *i = j - n;