diff options
author | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-08-17 18:04:43 +0200 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-08-22 08:55:06 +0000 |
commit | bbed8013ccc0b8de5dd0a77a9f764879babb3e02 (patch) | |
tree | a47e78ae38b8d3c1ef921240299c30a6134f3a3e /src/corelib/global/qglobal.h | |
parent | 330290e04935d318a5d7a02cb1cf12c8797ee0e4 (diff) |
Mark qBound/qMin/qMax as constexpr
On MSVC2015 Q_DECL_CONSTEXPR is defined as empty.
Change-Id: I8beb919f75cf2066ffc7ac10d5abfaa1712fc1bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r-- | src/corelib/global/qglobal.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b608489576..75d9655ea1 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 <typename T> -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 <typename T> -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 <typename T> -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 |