summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcolor.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2017-03-27 11:22:44 +0200
committerMarc Mutz <marc.mutz@kdab.com>2017-03-29 12:29:35 +0000
commit718023606370d7c0f972acb0ba83df3383b8800a (patch)
tree80f7929207bc73a1c5732d382c55cca2f1986621 /src/gui/painting/qcolor.h
parente9c06b25af47e869028c7a56a679fda7b4475f38 (diff)
QStringView: improve manual overload management
We want to prevent QStringView(QChar|QLatin1String|QByteArray|const char*) from compiling as QStringView(QString(...)), so I added = delete'ed ctors for these types to QStringView. However, that makes QStringView participate in overload resolution for these types. Even if the QStringView ctor will always fail to compile, the presence of these ctors alone makes calls to functions overloaded on QString and QStringView ambiguous: f(QStringView); f(QString); f(foo); // ambiguous f(QChar('f')) // ambiguous f(QLatin1String(foo)); // ambiguous f(QByteArray(foo)); // ambiguous Fix by making the QString and QStringRef constructors templates constrained to accept only these two types. This should also help to move the QStringView definition to before the QString one (as soon as we get rid of or start to ignore QString::Null), simplifying a lot of code in qstring.h down the line. This should also fix MSVC's accepting of two user-defined conversions which caused static non-compile-tests to fail in the initial QStringView patch, and which were therefore removed. This patch brings them back. Change-Id: I95ac38c0d31cd8c726f7e952017569d32e484413 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/painting/qcolor.h')
0 files changed, 0 insertions, 0 deletions