[Development] Making QScopedPointer scoped (again)

Thiago Macieira thiago.macieira at intel.com
Wed Sep 4 09:16:22 CEST 2013


On quarta-feira, 4 de setembro de 2013 09:00:14, Peter Kümmel wrote:
> But then you could use take() add wrap the pointer with something else,
> only this way I would call "explicit".

What's that something else? Remember that QScopedPointer was created to 
simplify handling of exceptions (when we tried to care about exceptions). If 
we have to take the pointer out and handle it manually, it defeats the entire 
purpose of QScopedPointer -- simplifying exception management.

To ensure proper RAII, we need to have a hand-off to another object. What class 
is that other object that allows returning or passing?

> Do we really wanna pollute Qt's API with QScopedPointer-s?

No, I don't. I'm just presenting arguments.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130904/4dd212ed/attachment.sig>


More information about the Development mailing list