summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcbormap.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2018-07-08 19:28:09 -0700
committerThiago Macieira <thiago.macieira@intel.com>2018-07-14 04:20:38 +0000
commit1016c0af740ebdf4b7dccfe5db5d63f07e4fee00 (patch)
tree84d28a511ad47f7011bbfc16bf9185b244f1166c /src/corelib/serialization/qcbormap.h
parent503646a3317c1041fb5ded803a3935ef330ea036 (diff)
CBOR: Use "noexcept" directly
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 <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/serialization/qcbormap.h')
-rw-r--r--src/corelib/serialization/qcbormap.h18
1 files changed, 9 insertions, 9 deletions
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<value_type> 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<QCborValue> 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(<compare>)
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<QCborContainerPrivate> d;
};