Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
What is the time complexity of QVector::toList() method?
InverseTransform last edited by InverseTransform
QVector()::toList()produce a new QList in O(n) by iterating and copying elements, or is this perhaps an O(1) operation? My testing indicates that this is a linear time conversion. Am I correct?
In general, is there documentation available regarding complexities for other related conversion operations, like
VRonin last edited by VRonin
fromList/Vector()methods are all copy element by element of one to the other. It's trivial to check: https://code.woboq.org/qt5/include/qt/QtCore/qvector.h.html#_ZNK7QVector6toListEv
QVector::toStdVectorcan leverage the fact that they both use contiguous memory and it boils down to little more than a
Some methods/classes declare their complexity in the description but I would say it's the exception rather than the norm