qt6-bb10/tests/auto/corelib/tools
Marc Mutz 462c958a92 QSpan: add as_(writable_)bytes
For std::span, these are free functions in namespace std and therefore
work for anything implicitly convertible to std::span,
incl. QSpan. But they're C++20, QSpan needs something for C++17
builds.

By adding them as hidden friends for QSpan, we allow unqualifid calls
to transparently resolve to the respective overload, ensuring
source-compatibility between std:: and QSpan, and, eventually, a
transition back to std::as_*_bytes.

I considered the alternative to add these functions in the q20
namespace, but q20::as_bytes() would have to take QSpan, and QSpan is
convertible from more types than std::span, so we wouldn't be able to
guarantee that std::as_bytes(t) works for all T t for which
q20::as_bytes(t) works, the fundamental guarantee for namespace qNN.

[ChangeLog][QtCore][QSpan] Added std::span-style as_bytes() and
as_writable_bytes() functions.

Fixes: QTBUG-125489
Change-Id: Ia9a7560c7843e182892608178433be7349c825ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 16:18:35 +02: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 QBitArray: use new comparison helper macros 2024-04-26 20:11:14 +02:00
qcache Change license for tests files 2024-02-04 09:56:42 +01:00
qcommandlineparser QCommandLineParser: remove redundant #ifdef from unittest 2024-03-16 16:41:03 +02:00
qcontiguouscache Change license for tests files 2024-02-04 09:56:42 +01:00
qcryptographichash tst_QCryptographicHash: mask a QSKIP in addDataAcceptsNullByteArrayView() 2024-05-19 14:27:01 +02:00
qduplicatetracker Change license for tests files 2024-02-04 09:56:42 +01:00
qeasingcurve QEasingCurve: use comparison helper macros 2024-05-10 16:31:28 +02: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 qHash: implement chunked hashing of QLatin1StringView 2024-03-12 17:23:09 -08:00
qhashfunctions qHash: make hashing of QLatin1StringView be the same as QString 2024-03-12 17:23:11 -08:00
qhashseed Fix test compilation issues with QtLite configuration 2024-05-06 14:29:02 +00:00
qline QLineF: add qFuzzyCompare and qFuzzyIsNull overloads 2024-05-10 15:33:40 +02: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 QMarginsF: add qFuzzyCompare and qFuzzyIsNull overloads 2024-05-10 15:33:40 +02: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 QPoint(F): use comparison helper macros 2024-05-10 15:33:39 +02:00
qpointf Add qFuzzyCompare() and qFuzzyIsNull() overloads for QPointF 2024-05-10 15:33:39 +02:00
qqueue Change license for tests files 2024-02-04 09:56:42 +01:00
qrect QRectF: add qFuzzyCompare and qFuzzyIsNull overloads 2024-05-10 15:33:40 +02: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 QSize(F): use comparison helper macros 2024-05-14 14:33:21 +02:00
qsizef QSizeF: add qFuzzyCompare and qFuzzyIsNull overloads 2024-05-14 14:33:21 +02:00
qspan QSpan: add as_(writable_)bytes 2024-05-23 16:18:35 +02: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 QTypeRevision: use comparison helper macros 2024-03-13 20:34:22 +01:00
quniquehandle Fix warning: remove unused parameter 2024-04-04 00:51:46 +00:00
qvarlengtharray QVarLengthArray: re-publish Prealloc as a nested PreallocatedSize 2024-02-15 17:44:36 +00:00
qversionnumber QVersionNumber: use new comparison helper macros 2024-05-06 22:47:55 +02:00
CMakeLists.txt Dissociate QTypeRevision from QVersionNumber 2024-01-10 02:25:24 +00:00