From a1e62e7ba14b00ac7c361936a18e7bc42bf1286d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 2 Apr 2019 10:54:54 +0200 Subject: Replace Q_DECL_NOEXCEPT with noexcept in corelib In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira --- src/corelib/tools/qversionnumber.h | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/corelib/tools/qversionnumber.h') diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 1bfb4aab39..d51947c091 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -87,7 +87,7 @@ class QVersionNumber }; // set the InlineSegmentMarker and set length to zero - SegmentStorage() Q_DECL_NOTHROW : dummy(1) {} + SegmentStorage() noexcept : dummy(1) {} SegmentStorage(const QVector &seg) { @@ -120,13 +120,13 @@ class QVersionNumber } #ifdef Q_COMPILER_RVALUE_REFS - SegmentStorage(SegmentStorage &&other) Q_DECL_NOTHROW + SegmentStorage(SegmentStorage &&other) noexcept : dummy(other.dummy) { other.dummy = 1; } - SegmentStorage &operator=(SegmentStorage &&other) Q_DECL_NOTHROW + SegmentStorage &operator=(SegmentStorage &&other) noexcept { qSwap(dummy, other.dummy); return *this; @@ -153,10 +153,10 @@ class QVersionNumber ~SegmentStorage() { if (isUsingPointer()) delete pointer_segments; } - bool isUsingPointer() const Q_DECL_NOTHROW + bool isUsingPointer() const noexcept { return (inline_segments[InlineSegmentMarker] & 1) == 0; } - int size() const Q_DECL_NOTHROW + int size() const noexcept { return isUsingPointer() ? pointer_segments->size() : (inline_segments[InlineSegmentMarker] >> 1); } void setInlineSize(int len) @@ -218,7 +218,7 @@ class QVersionNumber } m_segments; public: - inline QVersionNumber() Q_DECL_NOTHROW + inline QVersionNumber() noexcept : m_segments() {} inline explicit QVersionNumber(const QVector &seg) @@ -248,34 +248,34 @@ public: inline explicit QVersionNumber(int maj, int min, int mic) { m_segments.setSegments(3, maj, min, mic); } - Q_REQUIRED_RESULT inline bool isNull() const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline bool isNull() const noexcept { return segmentCount() == 0; } - Q_REQUIRED_RESULT inline bool isNormalized() const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline bool isNormalized() const noexcept { return isNull() || segmentAt(segmentCount() - 1) != 0; } - Q_REQUIRED_RESULT inline int majorVersion() const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline int majorVersion() const noexcept { return segmentAt(0); } - Q_REQUIRED_RESULT inline int minorVersion() const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline int minorVersion() const noexcept { return segmentAt(1); } - Q_REQUIRED_RESULT inline int microVersion() const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline int microVersion() const noexcept { return segmentAt(2); } Q_REQUIRED_RESULT Q_CORE_EXPORT QVersionNumber normalized() const; Q_REQUIRED_RESULT Q_CORE_EXPORT QVector segments() const; - Q_REQUIRED_RESULT inline int segmentAt(int index) const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline int segmentAt(int index) const noexcept { return (m_segments.size() > index) ? m_segments.at(index) : 0; } - Q_REQUIRED_RESULT inline int segmentCount() const Q_DECL_NOTHROW + Q_REQUIRED_RESULT inline int segmentCount() const noexcept { return m_segments.size(); } - Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const noexcept; - Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) noexcept; Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2); @@ -299,22 +299,22 @@ Q_DECLARE_TYPEINFO(QVersionNumber, Q_MOVABLE_TYPE); Q_CORE_EXPORT QDebug operator<<(QDebug, const QVersionNumber &version); #endif -Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept { return QVersionNumber::compare(lhs, rhs) > 0; } -Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool operator>=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept { return QVersionNumber::compare(lhs, rhs) >= 0; } -Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept { return QVersionNumber::compare(lhs, rhs) < 0; } -Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool operator<=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept { return QVersionNumber::compare(lhs, rhs) <= 0; } -Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool operator==(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept { return QVersionNumber::compare(lhs, rhs) == 0; } -Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool operator!=(const QVersionNumber &lhs, const QVersionNumber &rhs) noexcept { return QVersionNumber::compare(lhs, rhs) != 0; } QT_END_NAMESPACE -- cgit v1.2.3