summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qobject_p.h')
-rw-r--r--src/corelib/kernel/qobject_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/kernel/qobject_p.h b/src/corelib/kernel/qobject_p.h
index d98c7065f0..c77bdeff0d 100644
--- a/src/corelib/kernel/qobject_p.h
+++ b/src/corelib/kernel/qobject_p.h
@@ -319,11 +319,14 @@ public:
SignalVector *newVector = reinterpret_cast<SignalVector *>(malloc(sizeof(SignalVector) + (size + 1) * sizeof(ConnectionList)));
int start = -1;
if (vector) {
+ // not (yet) existing trait:
+ //static_assert(std::is_relocatable_v<SignalVector>);
+ //static_assert(std::is_relocatable_v<ConnectionList>);
memcpy(newVector, vector, sizeof(SignalVector) + (vector->allocated + 1) * sizeof(ConnectionList));
start = vector->count();
}
for (int i = start; i < int(size); ++i)
- newVector->at(i) = ConnectionList();
+ new (&newVector->at(i)) ConnectionList();
newVector->next = nullptr;
newVector->allocated = size;