Details
-
Suggestion
-
Resolution: Unresolved
-
P1: Critical
-
None
-
None
-
874be50e7 (dev)
-
Foundation PM Staging
Description
Following QTBUG-123851, we need literals for QUtf8StringView and QByteArrayView, too.
We should also add them for QASV, needs a different suffix, though, and the use of the QASV one should guarantee that L1 detection is done at compile-time (not like QTBUG-101014, which is only taking affect when assigning the QASV to a constexpr variable).
Open questions:
- what is ""_sv? A QByteArrayView or a QUtf8StringView (u8""_sv should be the latter, of course, so C++17/20 compat suggests that it be a QUtf8StringView). So ""_bav for QByteArrayView?
- what is the name of the UDLs for QAnyStringView? If C++ had template <char...> auto operator""_sv we could check in there for US-ASCII and return L1 or U8, depending on encoding, but that operator is only available for float/int literals; could maybe play tricks with passing the string as a non-type template argument, but that's probably C++20? Looks like we need _asv?
Attachments
Issue Links
- relates to
-
QTBUG-101014 QAnyStringView should auto-detect ASCII in 8-bit constexpr inputs
-
- Closed
-
- split from
-
QTBUG-123851 QStringView literals
-
- Closed
-