From bbed8013ccc0b8de5dd0a77a9f764879babb3e02 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Fri, 17 Aug 2018 18:04:43 +0200 Subject: [PATCH] Mark qBound/qMin/qMax as constexpr On MSVC2015 Q_DECL_CONSTEXPR is defined as empty. Change-Id: I8beb919f75cf2066ffc7ac10d5abfaa1712fc1bb Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b6084895769..75d9655ea1f 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -591,11 +591,11 @@ Q_DECL_CONSTEXPR inline qint64 qRound64(float d) { return d >= 0.0f ? qint64(d + 0.5f) : qint64(d - float(qint64(d-1)) + 0.5f) + qint64(d-1); } template -Q_DECL_CONSTEXPR inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; } +constexpr inline const T &qMin(const T &a, const T &b) { return (a < b) ? a : b; } template -Q_DECL_CONSTEXPR inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; } +constexpr inline const T &qMax(const T &a, const T &b) { return (a < b) ? b : a; } template -Q_DECL_CONSTEXPR inline const T &qBound(const T &min, const T &val, const T &max) +constexpr inline const T &qBound(const T &min, const T &val, const T &max) { return qMax(min, qMin(max, val)); } #ifndef Q_FORWARD_DECLARE_OBJC_CLASS