Since no answer mentioned it, Qt containers, including QVector
generally have a fuller API, which does enable a certain amount of extra convenience and reduces verbosity when compared to std::vector
.
QVector
isn't really integrated into the Qt APIs, that role is taken by misfit QList
, so it is not really a strong argument to use QVector
for overall better compatibility with Qt APIs. Note that this might change for Qt 6, as the shortcomings of QList
become more and more acknowledged.
That being said, if you already depend on Qt for your application, it would make good sense to use QVector
for the convenience. I presume that nobody is going to add such a bloated dependency as Qt just for a container or two. QVector
is efficient and a solid performer, and will run without problems on any platform, supported by Qt.
On the other hand, if you want to make a core logic API that is framework agnostic, it would be a good idea to develop it in standard C++ if possible, so you get something portable that isn't tied to a particular GUI framework so you can easily migrate it to a different one in the future if you need to.
Qt 6 update: Now QList
and QVector
are pretty much functionally identical.
File
which compares at all toQFile
.FILE*
is something entirely different. – Crumleyint
for sizes, so they can never store more than 2^31 elements on x86-64. – Shaman