Il 01/02/20 12:37, Alberto Mardegan ha scritto:
Do we need to have such a counterpart? In my work experience, when I'm
not allowed to use Qt and am restricted to the STL, all the times I had
to use std::unique_ptr was to get the same behaviour as a QScopedPointer.

So you never had to pass one to a function, return one from a function, create a vector of them? Color me *very* suspicious.


It's true that QScopedPointer offers only a subset of std::unique_ptr's
functionalities, but,*for that subset*, its name is just perfect.
That's why I wouldn't like to see it go away, or moved to a compat library.

The same subset is available in the Standard Library. The type you're looking for is "const std::unique_ptr".


So, I don't really care about std::unique_ptr, but I like Vitaly's
suggestion of having a QUniquePointer with a nice data() method.

How about working with upstream and convincing them that having data() (in addition to get()) on smart pointers is a good idea? Is having data() the _only_ argument here?

My 2 c,
--
Giuseppe D'Angelo | [email protected] | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to