Hello!
03.09.2013 15:33, Stephen Kelly ?????:
On Tuesday, September 03, 2013 12:48:51 Daniel Teske wrote:
*const* unique_ptr is a scoped ptr. So QScopedPointer is a NIH irregardless
of a move support.
First of all, I think, you should define what is a 'scoped'.
A const unique_ptr is like a Qt 5.1 QScopedPointer.
const unique_ptr never allows changes of contained raw pointer, but
QScopedPointer allows through reset() and swap(). Did you mean const
QScopedPointer?
A const unique_ptr can not be moved.
A const unique_ptr is *not* like a Qt 5.2 QScopedPointer.
A Qt 5.2 QScopedPointer can be moved.
That is why we have this thread. I am suggesting that a Qt 5.2 QScopedPointer
should not be movable.
I think QScopedPointer (depending on what is a 'scoped') should be
movable or it should not contain swap and reset at least.
swap() allows moving QScopedPointer:
void f(QScopedPointer &p) {
QScopedPointer x(...);
...
p.swap(x);
}
without swap() and reset() that isn't possible. So, QScopedPointer
already allows moving outside of scope and should have move-semantic.
Your point is also C++11 only. QScopedPointer also works with C++98.
So QScopedPointer still has a reason to exist, and it still has no reason to
be movable.
Thanks,
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development