From 1016c0af740ebdf4b7dccfe5db5d63f07e4fee00 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 8 Jul 2018 19:28:09 -0700 Subject: CBOR: Use "noexcept" directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All supported compilers support it. Doing this just for the new API. We should do it throughout Qt, but only if it won't interfere with the header review. Change-Id: Id59bdd8f1a804b809e22fffd153f9254688e5152 Reviewed-by: Edward Welbourne Reviewed-by: MÃ¥rten Nordheim --- src/corelib/serialization/qcbormap.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/corelib/serialization/qcbormap.h') diff --git a/src/corelib/serialization/qcbormap.h b/src/corelib/serialization/qcbormap.h index e61e8a60e1..15c9a5c50c 100644 --- a/src/corelib/serialization/qcbormap.h +++ b/src/corelib/serialization/qcbormap.h @@ -163,9 +163,9 @@ public: qsizetype operator-(ConstIterator j) const { return (item.i - j.item.i) / 2; } }; - QCborMap() Q_DECL_NOTHROW; - QCborMap(const QCborMap &other) Q_DECL_NOTHROW; - QCborMap &operator=(const QCborMap &other) Q_DECL_NOTHROW; + QCborMap() noexcept; + QCborMap(const QCborMap &other) noexcept; + QCborMap &operator=(const QCborMap &other) noexcept; QCborMap(std::initializer_list args) : QCborMap() { @@ -175,14 +175,14 @@ public: } ~QCborMap(); - void swap(QCborMap &other) Q_DECL_NOTHROW + void swap(QCborMap &other) noexcept { qSwap(d, other.d); } QCborValue toCborValue() const { return *this; } - qsizetype size() const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION; + qsizetype size() const noexcept Q_DECL_PURE_FUNCTION; bool isEmpty() const { return size() == 0; } QVector keys() const; @@ -232,7 +232,7 @@ public: bool contains(const QCborValue &key) const { const_iterator it = find(key); return it != end(); } - int compare(const QCborMap &other) const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION; + int compare(const QCborMap &other) const noexcept Q_DECL_PURE_FUNCTION; #if QT_HAS_INCLUDE() std::strong_ordering operator<=>(const QCborMap &other) const { @@ -242,9 +242,9 @@ public: return std::strong_ordering::less; } #else - bool operator==(const QCborMap &other) const Q_DECL_NOTHROW + bool operator==(const QCborMap &other) const noexcept { return compare(other) == 0; } - bool operator!=(const QCborMap &other) const Q_DECL_NOTHROW + bool operator!=(const QCborMap &other) const noexcept { return !(*this == other); } bool operator<(const QCborMap &other) const { return compare(other) < 0; } @@ -316,7 +316,7 @@ private: void detach(qsizetype reserve = 0); friend QCborValue; - explicit QCborMap(QCborContainerPrivate &dd) Q_DECL_NOTHROW; + explicit QCborMap(QCborContainerPrivate &dd) noexcept; QExplicitlySharedDataPointer d; }; -- cgit v1.2.3