summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qarraydatapointer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qarraydatapointer.h')
-rw-r--r--src/corelib/tools/qarraydatapointer.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h
index 51cfa6e849..af5173c9ad 100644
--- a/src/corelib/tools/qarraydatapointer.h
+++ b/src/corelib/tools/qarraydatapointer.h
@@ -52,7 +52,7 @@ private:
typedef QArrayDataOps<T> DataOps;
public:
- QArrayDataPointer() Q_DECL_NOTHROW
+ QArrayDataPointer() noexcept
: d(Data::sharedNull())
{
}
@@ -82,20 +82,18 @@ public:
return *this;
}
-#ifdef Q_COMPILER_RVALUE_REFS
- QArrayDataPointer(QArrayDataPointer &&other) Q_DECL_NOTHROW
+ QArrayDataPointer(QArrayDataPointer &&other) noexcept
: d(other.d)
{
other.d = Data::sharedNull();
}
- QArrayDataPointer &operator=(QArrayDataPointer &&other) Q_DECL_NOTHROW
+ QArrayDataPointer &operator=(QArrayDataPointer &&other) noexcept
{
QArrayDataPointer moved(std::move(other));
this->swap(moved);
return *this;
}
-#endif
DataOps &operator*() const
{
@@ -150,7 +148,7 @@ public:
bool isSharable() const { return d->isSharable(); }
#endif
- void swap(QArrayDataPointer &other) Q_DECL_NOTHROW
+ void swap(QArrayDataPointer &other) noexcept
{
qSwap(d, other.d);
}
@@ -204,22 +202,11 @@ inline bool operator!=(const QArrayDataPointer<T> &lhs, const QArrayDataPointer<
}
template <class T>
-inline void qSwap(QArrayDataPointer<T> &p1, QArrayDataPointer<T> &p2)
+inline void swap(QArrayDataPointer<T> &p1, QArrayDataPointer<T> &p2)
{
p1.swap(p2);
}
QT_END_NAMESPACE
-namespace std
-{
- template <class T>
- inline void swap(
- QT_PREPEND_NAMESPACE(QArrayDataPointer)<T> &p1,
- QT_PREPEND_NAMESPACE(QArrayDataPointer)<T> &p2)
- {
- p1.swap(p2);
- }
-}
-
#endif // include guard