qt5base-lts/tests/auto/corelib/tools/qscopedpointer
Giuseppe D'Angelo 5b9006bbdb Implement move-ctor and move-assignment-op for QScopedPointer
It makes sense for a QScopedPointer to be movable, for instance
for allowing instances to be returned from a function.
Ownwership of the managed pointer is still tied to one (and one only)
QScopedPointer instance.

Moreover, a move assignment operator makes sense as well, as it
implementing the equivalent of

  this->reset(other.take());

only when other is a rvalue and not a lvalue (so either it's a temporary
or it's getting explicitly moved in with std::move).

This makes QScopedPointer API's a bit closer to std::unique_ptr's one.

Task-number: QTBUG-29754
Change-Id: If1ac0c688327a67af4ad5b7ad45b439b022ed1c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2013-07-28 23:09:10 +02:00
..
.gitignore Moving relevant tests to corelib/tools 2011-09-01 13:07:23 +02:00
qscopedpointer.pro Implement move-ctor and move-assignment-op for QScopedPointer 2013-07-28 23:09:10 +02:00
tst_qscopedpointer.cpp Implement move-ctor and move-assignment-op for QScopedPointer 2013-07-28 23:09:10 +02:00