[docs] Add QSpan details to overview of C++20 features

Document that QSpan exists because we cannot use std::span, and
explicitly point to the differences between QSpan and std::span.

Task-number: QTBUG-128837
Pick-to: 6.8
Change-Id: I54f406e3306ee1da136107323887f0c87f94ff9b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 083ebfa1a5cb16b0b62ae5b5855a602b2f9ba818)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Ivan Solovev 2024-11-22 16:24:03 +01:00 committed by Qt Cherry-pick Bot
parent 4d009678ce
commit 8bd0625f54

View File

@ -40,4 +40,20 @@
facilities in place of platform-specific backends to access timezone facilities in place of platform-specific backends to access timezone
information. This remains experimental in Qt 6.9 as some standard library information. This remains experimental in Qt 6.9 as some standard library
implementations do not faithfully represent the IANA data for timezones. implementations do not faithfully represent the IANA data for timezones.
\section1 QSpan - a Qt version of \c {std::span}
The \l {https://en.cppreference.com/w/cpp/container/span}{std::span} class
template is an addition to the standard library that provides a uniform
way to access a contiguous portion of any contiguous container.
Using \c {std::span} in the public APIs of Qt could provide significant
advantages. However, Qt 6 only requires C++17, meaning it cannot have C++20
types in the API and ABI.
Qt 6.7 introduced \l QSpan - a Qt version of \c {std::span}. The API of the
class is compatible with the std version. \l QSpan and \c {std::span} can be
implicitly converted into each other. However, there are some differences
between the classes. See the corresponding section in the
\l {span-STL} {QSpan class documentation} for more details.
*/ */