summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qcborarray.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/qcborarray.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/qcborarray.h')
-rw-r--r--src/corelib/serialization/qcborarray.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/corelib/serialization/qcborarray.h b/src/corelib/serialization/qcborarray.h
index 07ef6428b2..e4c4d58c12 100644
--- a/src/corelib/serialization/qcborarray.h
+++ b/src/corelib/serialization/qcborarray.h
@@ -159,9 +159,9 @@ public:
typedef const QCborValue &const_reference;
typedef qsizetype difference_type;
- QCborArray() Q_DECL_NOTHROW;
- QCborArray(const QCborArray &other) Q_DECL_NOTHROW;
- QCborArray &operator=(const QCborArray &other) Q_DECL_NOTHROW;
+ QCborArray() noexcept;
+ QCborArray(const QCborArray &other) noexcept;
+ QCborArray &operator=(const QCborArray &other) noexcept;
QCborArray(std::initializer_list<QCborValue> args)
: QCborArray()
{
@@ -171,14 +171,14 @@ public:
}
~QCborArray();
- void swap(QCborArray &other) Q_DECL_NOTHROW
+ void swap(QCborArray &other) noexcept
{
qSwap(d, other.d);
}
QCborValue toCborValue() const { return *this; }
- qsizetype size() const Q_DECL_NOTHROW;
+ qsizetype size() const noexcept;
bool isEmpty() const { return size() == 0; }
QCborValue at(qsizetype i) const;
@@ -205,7 +205,7 @@ public:
bool contains(const QCborValue &value) const;
- int compare(const QCborArray &other) const Q_DECL_NOTHROW Q_DECL_PURE_FUNCTION;
+ int compare(const QCborArray &other) const noexcept Q_DECL_PURE_FUNCTION;
#if QT_HAS_INCLUDE(<compare>)
std::strong_ordering operator<=>(const QCborArray &other) const
{
@@ -215,9 +215,9 @@ public:
return std::strong_ordering::less;
}
#else
- bool operator==(const QCborArray &other) const Q_DECL_NOTHROW
+ bool operator==(const QCborArray &other) const noexcept
{ return compare(other) == 0; }
- bool operator!=(const QCborArray &other) const Q_DECL_NOTHROW
+ bool operator!=(const QCborArray &other) const noexcept
{ return !(*this == other); }
bool operator<(const QCborArray &other) const
{ return compare(other) < 0; }
@@ -261,7 +261,7 @@ private:
void detach(qsizetype reserve = 0);
friend QCborValue;
- explicit QCborArray(QCborContainerPrivate &dd) Q_DECL_NOTHROW;
+ explicit QCborArray(QCborContainerPrivate &dd) noexcept;
QExplicitlySharedDataPointer<QCborContainerPrivate> d;
};