QWeakPointer: mark as nothrow {default,copy} {constructible,assignable}

Change-Id: I6757a775c72f15c210004dc25d962ec5d3b88012
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Marc Mutz 2015-06-27 13:51:27 +02:00
parent 78dd962f68
commit 39a472430f
1 changed files with 6 additions and 5 deletions

View File

@ -597,7 +597,7 @@ public:
inline bool operator !() const { return isNull(); }
inline T *data() const { return d == Q_NULLPTR || d->strongref.load() == 0 ? Q_NULLPTR : value; }
inline QWeakPointer() : d(Q_NULLPTR), value(Q_NULLPTR) { }
inline QWeakPointer() Q_DECL_NOTHROW : d(Q_NULLPTR), value(Q_NULLPTR) { }
inline ~QWeakPointer() { if (d && !d->weakref.deref()) delete d; }
#ifndef QT_NO_QOBJECT
@ -615,15 +615,16 @@ public:
{ return *this = QWeakPointer(ptr); }
#endif
inline QWeakPointer(const QWeakPointer &o) : d(o.d), value(o.value)
QWeakPointer(const QWeakPointer &other) Q_DECL_NOTHROW : d(other.d), value(other.value)
{ if (d) d->weakref.ref(); }
inline QWeakPointer &operator=(const QWeakPointer &o)
QWeakPointer &operator=(const QWeakPointer &other) Q_DECL_NOTHROW
{
internalSet(o.d, o.value);
QWeakPointer copy(other);
swap(copy);
return *this;
}
inline void swap(QWeakPointer &other)
void swap(QWeakPointer &other) Q_DECL_NOTHROW
{
qSwap(this->d, other.d);
qSwap(this->value, other.value);