Details
-
Task
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
None
Description
QTextStream is basically a fancy way to append to a string, not saving any one of them individually, so this API is a perfect candidate for supporting QAnyStringViews.
In general, the QTextStream API (QDebug, QDataStream, iostreams all have the same problem to varying extent) is flawed in that it allows implicit conversions.
It would be better if stream operators were hidden friends of the streamed data types and, for built-in types, were constrained to disallow implicit conversion.
That, or we just always provide the most-encompassing type (intmax_t, uintmax_t, long double, QAnyStringView) in the traditional way. But what about bool, e.g.?
I'm mentioning that here because it means we should start to add QAnyStringView and QUtf8StringView streaming as hidden friends of the views, not, as it was done before, as a member function of the stream.
Acceptance criteria:
- can stream QAnyStringView and QUtf8StringView into QTextStream
- decided which path to take w.r.t. overloading stream operators
Attachments
Issue Links
- relates to
-
QTBUG-114935 Allow streaming QAnyStringView into QDebug
-
- Closed
-