mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
Removed workarounds that were needed to support older versions of MSVC.
This commit is contained in:
@@ -47,10 +47,10 @@ namespace BlackMisc
|
|||||||
const QLatin1String m_latin1;
|
const QLatin1String m_latin1;
|
||||||
|
|
||||||
//! Implicit constructor.
|
//! Implicit constructor.
|
||||||
Q_DECL_CONSTEXPR CExplicitLatin1String(QLatin1String s) : m_latin1(s) {}
|
constexpr CExplicitLatin1String(QLatin1String s) : m_latin1(s) {}
|
||||||
|
|
||||||
//! Implicit conversion.
|
//! Implicit conversion.
|
||||||
Q_DECL_CONSTEXPR operator QLatin1String() const { return m_latin1; }
|
constexpr operator QLatin1String() const { return m_latin1; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -209,12 +209,12 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
//! Construct a unit with custom conversion
|
//! Construct a unit with custom conversion
|
||||||
template <class Converter>
|
template <class Converter>
|
||||||
Q_DECL_CONSTEXPR Data(QLatin1String name, QLatin1String symbol, Converter, int displayDigits = 2, double epsilon = 1e-9)
|
constexpr Data(QLatin1String name, QLatin1String symbol, Converter, int displayDigits = 2, double epsilon = 1e-9)
|
||||||
: m_name(name), m_symbol(symbol), m_epsilon(epsilon), m_displayDigits(displayDigits), m_toDefault(Converter::toDefault), m_fromDefault(Converter::fromDefault)
|
: m_name(name), m_symbol(symbol), m_epsilon(epsilon), m_displayDigits(displayDigits), m_toDefault(Converter::toDefault), m_fromDefault(Converter::fromDefault)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//! Construct a null unit
|
//! Construct a null unit
|
||||||
Q_DECL_CONSTEXPR Data(QLatin1String name, QLatin1String symbol)
|
constexpr Data(QLatin1String name, QLatin1String symbol)
|
||||||
: m_name(name), m_symbol(symbol)
|
: m_name(name), m_symbol(symbol)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
//! Workaround to constant-initialize QLatin1String on platforms without constexpr strlen.
|
//! Workaround to constant-initialize QLatin1String on platforms without constexpr strlen.
|
||||||
template <int N>
|
template <int N>
|
||||||
static Q_DECL_CONSTEXPR QLatin1String constQLatin1(const char (&str)[N])
|
static 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