QList: more explicitly document capacity() shenanigans

Due to capacity() reporting the size of all allocated space, this is
somewhat inconsistent with what QVector::capacity() in Qt5 provided,
due to Q6List being double-ended. So let's document this better

Task-number: QTBUG-92941
Pick-to: 6.2
Change-Id: Iba46389121e721a8d21f0344b154f41c2c245867
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Andrei Golubev 2021-06-16 11:31:57 +02:00
parent 52b2346742
commit 976cf0152b

View File

@ -485,9 +485,10 @@
\note a statically allocated list will report a capacity of 0,
even if it's not empty.
\note The free space position in the allocated memory block is undefined. In
other words, one should not assume that the free memory is always located
after the initialized elements.
\warning The free space position in the allocated memory block is undefined.
In other words, you should not assume that the free memory is always located
at the end of the list. You can call reserve() to ensure that there is
enough space at the end.
\sa reserve(), squeeze()
*/