qt6-bb10/tests/auto/corelib/serialization
Giuseppe D'Angelo 7ce6920aac Containers: add max_size()
One more method for STL compatibility.
This one is particularly subtle as it's required by the
`reservable-container` concept:

https://eel.is/c++draft/ranges#range.utility.conv.general-3

Without this concept, ranges::to won't reserve() before copying the
elements (out of a sized range which isn't a common_range).

Implementation notes: there were already a couple of constants denoting
the maximum QByteArray and QString size. Centralize that implementation
in QTypedArrayData, so that QList can use it too.

The maximum allocation size (private constant) needs a even more central
place so that even QVLA can use it. Lacking anything better, I've put it
in qcontainerfwd.h.

Since our containers aren't allocator-aware, I can make max_size() a
static member, and replace the existing constants throughout the rest of
qtbase. (I can't kill them yet as they're used by other submodules.)

[ChangeLog][QtCore][QList] Added max_size().

[ChangeLog][QtCore][QString] Added max_size().

[ChangeLog][QtCore][QByteArray] Added max_size().

[ChangeLog][QtCore][QVarLengthArray] Added max_size().

Change-Id: I176142e31b998f4f787c96333894b8f6653eb70d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-27 16:58:27 +01:00
..
json Change license for tests files 2024-02-04 09:56:42 +01:00
qcborstreamreader Containers: add max_size() 2024-02-27 16:58:27 +01:00
qcborstreamwriter Change license for tests files 2024-02-04 09:56:42 +01:00
qcborvalue Containers: add max_size() 2024-02-27 16:58:27 +01:00
qcborvalue_json Change license for tests files 2024-02-04 09:56:42 +01:00
qdatastream Deprecate QDataStream::readBytes(char *&, uint &) instead of removing it 2024-02-07 15:02:19 +01:00
qdatastream_core_pixmap Change license for tests files 2024-02-04 09:56:42 +01:00
qtextstream Change license for tests files 2024-02-04 09:56:42 +01:00
qxmlstream Change license for tests files 2024-02-04 09:56:42 +01:00
CMakeLists.txt wasm tests: Disable unstable qcborvalue test 2023-11-23 19:26:49 +01:00
cborlargedatavalidation.cpp Change license for tests files 2024-02-04 09:56:42 +01:00