Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
6.6
-
None
Description
QStringBuilder defines operator% (and operator+ under QT_USE_STRINGBUILDER) between types that normally don't have operator+.
For the sake of API symmetry, such operator+ overloads should be added when QT_USE_STRINGBUILDER is not available.
Basically: everything I can write as a % b shall also compile as a + b, with identical semantics.
Example:
// not under QT_USE_STRINGBUILDER QStringView s; s + s; // error, no such operator s % s; // ok
Incomplete list:
- operator+(QString, QStringView) and reversed
- operator+(QStringView, QStringView)
- operator+(QByteArray, QByteArrayView) and reversed
- operator+(QLatin1StringView, QLatin1StringView)
- operator+(QLatin1Char, QLatin1Char)
- operator+(QChar, QChar)
Probably more. The last two are outright scary and probably warrant a QSB redesign. (Also, concatenating views through operator+ sounds a bit strange.)
Attachments
Issue Links
- duplicates
-
QTBUG-109081 Not all string concatenation operations are possible when QStringBuilder is disabled
-
- Reported
-