[Development] Making QScopedPointer scoped (again)

Oswald Buddenhagen oswald.buddenhagen at digia.com
Tue Sep 3 22:12:58 CEST 2013


On Tue, Sep 03, 2013 at 09:20:20PM +0200, Peter Kümmel wrote:
> >> 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.
> 
> I have to agree with Steven. After allowing moving, the semantic is
> different to the naming: after this change we could write in the docs
> 
>      "QScopedPointer sometimes deletes when it leaves the scope."
> 
> Which makes it obvious that "QScopedPointer" is the wrong name for such a behavior.
> 
actually, it is 

    "A non-null QScopedPointer deletes when it leaves the scope."

which sounds quite reasonable to me.




More information about the Development mailing list