Will the items pointer changed after QList::RemoveAt(i)?
-
Hi
http://doc.qt.io/qt-5/qlist.html#details"Internally, QList<T> is represented as an array of T "
so array.
-
Hi
http://doc.qt.io/qt-5/qlist.html#details"Internally, QList<T> is represented as an array of T "
so array.
@mrjj That's only part of the truth :-)
"Internally, QList<T> is represented as an array of T if sizeof(T) <= sizeof(void*) and T has been declared to be either a Q_MOVABLE_TYPE or a Q_PRIMITIVE_TYPE using Q_DECLARE_TYPEINFO. Otherwise, QList<T> is represented as an array of T* and the items are allocated on the heap." -
@mrjj That's only part of the truth :-)
"Internally, QList<T> is represented as an array of T if sizeof(T) <= sizeof(void*) and T has been declared to be either a Q_MOVABLE_TYPE or a Q_PRIMITIVE_TYPE using Q_DECLARE_TYPEINFO. Otherwise, QList<T> is represented as an array of T* and the items are allocated on the heap." -
@mrjj That's only part of the truth :-)
"Internally, QList<T> is represented as an array of T if sizeof(T) <= sizeof(void*) and T has been declared to be either a Q_MOVABLE_TYPE or a Q_PRIMITIVE_TYPE using Q_DECLARE_TYPEINFO. Otherwise, QList<T> is represented as an array of T* and the items are allocated on the heap." -
@mrjj That's only part of the truth :-)
"Internally, QList<T> is represented as an array of T if sizeof(T) <= sizeof(void*) and T has been declared to be either a Q_MOVABLE_TYPE or a Q_PRIMITIVE_TYPE using Q_DECLARE_TYPEINFO. Otherwise, QList<T> is represented as an array of T* and the items are allocated on the heap." -
Hi,
I'd recommend reading this excellent blog about Qt's containers.
-
Hi,
I'd recommend reading this excellent blog about Qt's containers.
Looks interesting. I'll read it when I have the time, although I already know Qt's containers have a somewhat poorer performance on average. However I just couldn't bring myself to like the C-style underscore API of STL. And I couldn't help myself but think that the whole "move semantics" nonsense in C++11 was invented only to mitigate the STL's containers' deep copy inefficiencies. Still, the points raised in the article are valid.