[Development] Making QScopedPointer scoped (again)

Daniel Teske daniel.teske at digia.com
Tue Sep 3 12:48:51 CEST 2013


> Again, this is what std::unique_ptr is for. We should not try to turn
> QScopedPointer into an attempt at a NIH std::unique_ptr. Where people have
> a need for a std::unique_ptr, they should use it. We should not adapt
> QScopedPointer to fit the need instead.
> 
> Adding a move contructor to QScopedPointer makes no sense, because moving
> means 'escaping the scope', which breaks the fundamental point of
> QScopedPointer. QScopedPointer is different to std::unique_ptr and should
> remain so.

*const* unique_ptr is a scoped ptr. So QScopedPointer is a NIH irregardless of 
a move support. 
 
daniel



More information about the Development mailing list