Qt and Trivial Relocation (Part 2) -- Giuseppe D'Angelo
In this installment we are going to explore the relationships between trivial relocation and move assignments.
Qt and Trivial Relocation (Part 2)
by Giuseppe D'Angelo
From the article:
Last time we started our investigation of trivial relocation by considering an important use-case: reallocating a vector. This happens when a vector reaches its capacity, but more storage is needed.
Let’s now consider a different operation: erasing an element from the middle of a QVector.
How do we go about it?


This article explores techniques to access specific elements within a C++ parameter pack by index. It delves into the use of
In the
In Qt 4, container classes like QVector introduced an optimization that transformed certain operations on contained objects into efficient byte-level manipulations. By identifying types that can be safely moved via a simple memory copy, Qt was able to streamline reallocations for specific data types like 