qt5base-lts/tests/auto/corelib/text/qstringview
Giuseppe D'Angelo 50f3ccd782 QStringView: add a test for overload resolution versus QString
In the presence of multiple overloads of a function taking either
QString or QStringView, QStringView should always be preferred.

The rationale is that the QStringView overload may have been
added "later" (read: the function was written when QStringView
was not available yet, so it took QString), and the fact that
a function with the _same name_ offers a QStringView overload
implies the function never needed to store/own the string in
the first place.

Add a (compile-time) test for this preference. This is in
preparation for a future QString(char16_t*) constructor
(in Qt 5.15 / Qt 6).

Change-Id: I60a435e494b653548f8f8d52c5d7e7cac2cc875a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-09 00:01:55 +01:00
..
.gitignore Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00
qstringview.pro Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00
tst_qstringview.cpp QStringView: add a test for overload resolution versus QString 2020-01-09 00:01:55 +01:00