The comparison with QStringView works as is, there is no need to add explicit operators. Add the missing relational operators with QUtf8StringView. Once it is added, comparison of QString with u8"string literal" becomes ambiguous, so explicitly add operators for `const char8_t*` as well. This also makes the comparison with u8 string literals faster, because it now uses a view instead of constructing a QString. Adding QUtf8StringView overloads also makes comparison with `const char *` ambiguous if QT_RESTRICTED_CAST_FROM_ASCII is defined. To fix that, mark the overload as Q_WEAK_OVERLOAD. Luckily, we can just use the third Attributes parameter of the macro for that. Provide more unit-tests to cover the new relational operators. Task-number: QTBUG-117661 Change-Id: I60d1f4ad7ea607472deeb5c250e62f2bb7019268 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| CMakeLists.txt | ||
| double_data.h | ||
| tst_qstring.cpp | ||
| tst_qstring_mac.mm | ||
| tst_qstring_wasm.cpp | ||