qt6-bb10/tests/auto/corelib/tools
Giuseppe D'Angelo 73bf1c1a9b QList: add uninitialized resizes
Creating a QList of a given size, or resizing it to a given size, will
always value-initialize its elements. This commit adds support for
uninitialized construction and resizes. The intended use case is using a
QList as storage-to-be-overwritten:

  QList<int> list(size, Qt::Uninitialized);

  fillWithData(list.data(), list.size);

How do we define "uninitialized":

1) if T is constructible using Qt::Uninitialized, use that;
2) otherwise, default-construct T.

In detail:

1) covers (Qt-ish) datatypes that have a default constructor that
   initializes them, but also a dedicated constructor that doesn't
   initialize (e.g. QPoint, QQuaternion, ...).
2) covers everything else. Default initialization of scalars and
   trivially constructible datatypes will leave them uninitialized.

A type which isn't trivially constructible will still get its default
constructor called (and possibly actually gets initialized); we can't
really do better than that, as we still have to construct objects and
start their lifetimes.

[ChangeLog][QtCore][QList] Added support for uninitialized construction
and resizing.

Change-Id: I32c285c7dddbf7e01475943f24e14e824bb13090
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-16 14:20:50 +01:00
..
collections Remove extra semi-colons 2024-02-06 20:17:18 +09:00
containerapisymmetry Change license for tests files 2024-02-04 09:56:42 +01:00
qalgorithms Change license for tests files 2024-02-04 09:56:42 +01:00
qarraydata Change license for tests files 2024-02-04 09:56:42 +01:00
qatomicscopedvaluerollback Change license for tests files 2024-02-04 09:56:42 +01:00
qbitarray Change license for tests files 2024-02-04 09:56:42 +01:00
qcache Change license for tests files 2024-02-04 09:56:42 +01:00
qcommandlineparser Change license for tests files 2024-02-04 09:56:42 +01:00
qcontiguouscache Change license for tests files 2024-02-04 09:56:42 +01:00
qcryptographichash Change license for tests files 2024-02-04 09:56:42 +01:00
qduplicatetracker Change license for tests files 2024-02-04 09:56:42 +01:00
qeasingcurve Change license for tests files 2024-02-04 09:56:42 +01:00
qexplicitlyshareddatapointer Change license for tests files 2024-02-04 09:56:42 +01:00
qflatmap Change license for tests files 2024-02-04 09:56:42 +01:00
qfreelist Change license for tests files 2024-02-04 09:56:42 +01:00
qhash Change license for tests files 2024-02-04 09:56:42 +01:00
qhashfunctions qHash: backport the q(u)int128-to-quint64 reduction trick to 32-bit 2024-02-12 17:01:33 -08:00
qhashseed Change license for tests files 2024-02-04 09:56:42 +01:00
qline Change license for tests files 2024-02-04 09:56:42 +01:00
qlist QList: add uninitialized resizes 2024-02-16 14:20:50 +01:00
qmacautoreleasepool Change license for tests files 2024-02-04 09:56:42 +01:00
qmakearray Change license for tests files 2024-02-04 09:56:42 +01:00
qmap QMap: add missing qHash() overload 2024-02-09 20:33:05 +00:00
qmargins Change license for tests files 2024-02-04 09:56:42 +01:00
qmessageauthenticationcode Change license for tests files 2024-02-04 09:56:42 +01:00
qoffsetstringarray Change license for tests files 2024-02-04 09:56:42 +01:00
qpair Change license for tests files 2024-02-04 09:56:42 +01:00
qpoint Change license for tests files 2024-02-04 09:56:42 +01:00
qpointf Change license for tests files 2024-02-04 09:56:42 +01:00
qqueue Change license for tests files 2024-02-04 09:56:42 +01:00
qrect Change license for tests files 2024-02-04 09:56:42 +01:00
qringbuffer Change license for tests files 2024-02-04 09:56:42 +01:00
qscopedpointer Change license for tests files 2024-02-04 09:56:42 +01:00
qscopedvaluerollback Change license for tests files 2024-02-04 09:56:42 +01:00
qscopeguard Change license for tests files 2024-02-04 09:56:42 +01:00
qset Change license for tests files 2024-02-04 09:56:42 +01:00
qsharedpointer Change license for tests files 2024-02-04 09:56:42 +01:00
qsize Change license for tests files 2024-02-04 09:56:42 +01:00
qsizef Change license for tests files 2024-02-04 09:56:42 +01:00
qspan Change license for tests files 2024-02-04 09:56:42 +01:00
qstl Change license for tests files 2024-02-04 09:56:42 +01:00
qtaggedpointer Change license for tests files 2024-02-04 09:56:42 +01:00
qtimeline Change license for tests files 2024-02-04 09:56:42 +01:00
qtyperevision Change license for tests files 2024-02-04 09:56:42 +01:00
quniquehandle Change license for tests files 2024-02-04 09:56:42 +01:00
qvarlengtharray QVarLengthArray: re-publish Prealloc as a nested PreallocatedSize 2024-02-15 17:44:36 +00:00
qversionnumber Change license for tests files 2024-02-04 09:56:42 +01:00
CMakeLists.txt Dissociate QTypeRevision from QVersionNumber 2024-01-10 02:25:24 +00:00