[Interest] why does Qt prefer to return QList over QVector?
felixover at gmail.com
Tue Jan 27 08:56:45 CET 2015
i recently gained a small, but considerable performance boost by switching
out QList for QVector in some legacy code. This is hindered by the fact
that Qt itself often returns QList, eg with QMap::values().
Is there a reason for this? Why arent QVectors used?
A somewhat related question, why is there no QList::reserve()? I guess i
see how that function might not make much sense from an algorithmic pov,
but shouldnt it at least be there as a NoOp to make it easy switching
between data structures?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest