[Interest] Advice on QSharedPointer versus QExplicitlySharedDataPointer

Constantin Makshin cmakshin at gmail.com
Fri Jul 19 21:53:54 CEST 2013


Oh, thanks, didn't know about it (it was undocumented until 5.1 which I
don't use [yet]).
On Jul 19, 2013 11:38 PM, "Thiago Macieira" <thiago.macieira at intel.com>
wrote:

> On sexta-feira, 19 de julho de 2013 23.31.48, Constantin Makshin wrote:
> > QSharedPointer is good when you want to use the same object in several
> > places without the need to worry about that object's lifetime because the
> > [automatic] reference counting takes care of that. Another advantage is
> > that it can hold an object of any type, not just ones derived from
> > QSharedData. But if C++11 is acceptable for the project, I'd prefer
> > std::shared_ptr because of std::make_shared which provides more efficient
> > and exception-friendly allocation method.
>
> QSharedPointer::create().
>
> Also exception-safe.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130719/c00112ab/attachment.html>


More information about the Interest mailing list