QSharedPointer: implement move ctor

Change-Id: I46974aa1d056be797db959b547a1516157b598ca
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2014-02-22 23:47:46 +01:00 committed by The Qt Project
parent 9788c0f47c
commit ad5f6d4326

View File

@ -327,6 +327,12 @@ public:
return *this;
}
#ifdef Q_COMPILER_RVALUE_REFS
inline QSharedPointer(QSharedPointer &&other)
: value(other.value), d(other.d)
{
other.d = 0;
other.value = 0;
}
inline QSharedPointer<T> &operator=(QSharedPointer<T> &&other)
{
swap(other);