mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +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;
|
||||
|
||||
//! Implicit constructor.
|
||||
Q_DECL_CONSTEXPR CExplicitLatin1String(QLatin1String s) : m_latin1(s) {}
|
||||
constexpr CExplicitLatin1String(QLatin1String s) : m_latin1(s) {}
|
||||
|
||||
//! 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
|
||||
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)
|
||||
{}
|
||||
|
||||
//! Construct a null unit
|
||||
Q_DECL_CONSTEXPR Data(QLatin1String name, QLatin1String symbol)
|
||||
constexpr Data(QLatin1String name, QLatin1String symbol)
|
||||
: m_name(name), m_symbol(symbol)
|
||||
{}
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace BlackMisc
|
||||
|
||||
//! Workaround to constant-initialize QLatin1String on platforms without constexpr strlen.
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user