[docs] QAnyStringView: mention automatic U8→L1 reclassification

...for US-ASCII literals.

Amends eaabd0c545.

Pick-to: 6.4
Task-number: QTBUG-101014
Change-Id: Id0acccb9bf2dfb01bca93f62da634e8dfe299fbc
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Marc Mutz 2022-08-12 22:38:48 +02:00
parent f8c23116bb
commit c51c4aa2c5
1 changed files with 5 additions and 0 deletions

View File

@ -45,6 +45,11 @@
Like elsewhere in Qt, QAnyStringView assumes \c char data is encoded
in UTF-8, unless it is presented as a QLatin1StringView.
Since Qt 6.4, however, UTF-8 string literals that are pure US-ASCII are
automatically stored as Latin-1. This is a compile-time check with no
runtime overhead. The feature requires compiling in C++20, or with a recent
GCC.
QAnyStringViews should be passed by value, not by reference-to-const:
\snippet code/src_corelib_text_qanystringview.cpp 0