mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
Change template parameter to disambiguate call to QLatin1String constructor
Summary: Qt 5.10 added a new constructor overload which made the call to QLatin1String constructor with size_t as second parameter ambigious. Reviewers: #swift_pilot_client, msutcliffe Reviewed By: #swift_pilot_client, msutcliffe Subscribers: jenkins Differential Revision: https://dev.swift-project.org/D47
This commit is contained in:
committed by
Mathew Sutcliffe
parent
4b34aff39d
commit
c91aa0d58e
@@ -227,7 +227,7 @@ namespace BlackMisc
|
|||||||
};
|
};
|
||||||
|
|
||||||
//! Workaround to constant-initialize QLatin1String on platforms without constexpr strlen.
|
//! Workaround to constant-initialize QLatin1String on platforms without constexpr strlen.
|
||||||
template <size_t N>
|
template <int N>
|
||||||
static Q_DECL_CONSTEXPR QLatin1String constQLatin1(const char (&str)[N])
|
static Q_DECL_CONSTEXPR QLatin1String constQLatin1(const char (&str)[N])
|
||||||
{
|
{
|
||||||
return QLatin1String(str, N - 1); // -1 because N includes the null terminator
|
return QLatin1String(str, N - 1); // -1 because N includes the null terminator
|
||||||
|
|||||||
Reference in New Issue
Block a user