<table><tr><td style="">aaronpuchert added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9236" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>It might not actually be faster though, because you go through the memory twice. If the vector doesn't fit into the cache, that could introduce quite some slowdown.</p>

<p>On the other hand, copying deep objects can obviously be costly. Some of the vector element types seem to carry around some baggage.</p>

<p>The C++11 way would be to move such objects, can we do that? It seems to be supported via <tt style="background: #ebebeb; font-size: 13px;">QVector<T>::push_back(T&& t)</tt>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R32 KDevelop</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9236" rel="noreferrer">https://phabricator.kde.org/D9236</a></div></div><br /><div><strong>To: </strong>kossebau, KDevelop<br /><strong>Cc: </strong>aaronpuchert, brauch, kdevelop-devel<br /></div>