On Friday 10 July 2015 17:01:04 Smith Martin wrote: > And apparently QVector has the same API as QList now, so why don't we > deprecate QList. Let it always create a QVector.
Do you mean deprecate for use inside Qt? Maybe in Qt 6 or 7.
In general? For user code as well? HELL NO! (sorry for the shouting...)
Thiago listed a few exceptions under which the use of lists is legitimate.
These situations exist - more frequently than some of you seem to believe.
At least in code that was not written under ideal circumstances (which in my
sad little corner of industry is about 99.5% of all code).
Believe it or not - I've got plenty of code in which I frequently and
dynamically change the size of lists of complex objects. Doing this with
QVector would create its own kind of re-allocation hell. And no, for most of
these instances it's impossible to predict how large the list will be before
it is complete - it often depends on data that first needs to be parsed,
analysed, requested, or otherwise pulled piecewise out of some remote
process' tight grasp.
If Qt deprecated QList I would have to convert a lot of legacy code to
std::list; neither QVector (allocation hell) nor QLinkedList (slow retrieval
with large data sets) are serious alternatives.
Konrad
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
