diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-31 09:46:56 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-01-31 11:27:30 +0100 |
commit | 511cb760ee1a35ee1adbb253f5d3f0c16bb91df5 (patch) | |
tree | c1ded44157a485983740d7824670bc2d5ab3eca3 | |
parent | 6251963ecd26bfc480b2871e26b6df4d7ab88cee (diff) |
qversionnumber.h: Stay compatible with C++11
Avoiding relaxed constexpr support is a small change that doesn't hurt
and it allows us to progress in qtdeclarative without waiting for
general C++17 support in qtbase.
Change-Id: I234276036292346d60d6da3a75bcabbdec9ddde8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r-- | src/corelib/tools/qversionnumber.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 9fd4242859..16058bd04a 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -344,30 +344,30 @@ public: if_valid_segment_type<Minor> = true> static constexpr QTypeRevision fromVersion(Major majorVersion, Minor minorVersion) { - Q_ASSERT(isValidSegment(majorVersion)); - Q_ASSERT(isValidSegment(minorVersion)); - return QTypeRevision(quint8(majorVersion), quint8(minorVersion)); + return Q_ASSERT(isValidSegment(majorVersion)), + Q_ASSERT(isValidSegment(minorVersion)), + QTypeRevision(quint8(majorVersion), quint8(minorVersion)); } template<typename Major, if_valid_segment_type<Major> = true> static constexpr QTypeRevision fromMajorVersion(Major majorVersion) { - Q_ASSERT(isValidSegment(majorVersion)); - return QTypeRevision(quint8(majorVersion), SegmentUnknown); + return Q_ASSERT(isValidSegment(majorVersion)), + QTypeRevision(quint8(majorVersion), SegmentUnknown); } template<typename Minor, if_valid_segment_type<Minor> = true> static constexpr QTypeRevision fromMinorVersion(Minor minorVersion) { - Q_ASSERT(isValidSegment(minorVersion)); - return QTypeRevision(SegmentUnknown, quint8(minorVersion)); + return Q_ASSERT(isValidSegment(minorVersion)), + QTypeRevision(SegmentUnknown, quint8(minorVersion)); } template<typename Integer, if_valid_value_type<Integer> = true> static constexpr QTypeRevision fromEncodedVersion(Integer value) { - Q_ASSERT((value & ~Integer(0xffff)) == Integer(0)); - return QTypeRevision((value & Integer(0xff00)) >> 8, value & Integer(0xff)); + return Q_ASSERT((value & ~Integer(0xffff)) == Integer(0)), + QTypeRevision((value & Integer(0xff00)) >> 8, value & Integer(0xff)); } static constexpr QTypeRevision zero() { return QTypeRevision(0, 0); } |