On Thu, Sep 8, 2016 at 7:50 PM, Elvis Stansvik <elvst...@gmail.com> wrote:
> Hi all, > QSharedData and QImplicitlySharedDataPointer (QISDP) is a common > combination used to implement implicit sharing, both in Qt itself and > in Qt-using projects. > QSharedDataPointer, the implicit part is implicit. ;) > > I'm curious about the role/use for QESDP compared to QSharedPointer. > The main differences I can see is > QESDP has internal reference counting while QSharedPointer utilizes external reference counting. > But regarding this second difference, wouldn't it be easy enough to > just take the raw pointer to the underlying object with data(), and > make a copy of that? > Thread safety isn't guaranteed in that case. > In short, I fail to see a strong use case for QESDP compared to using > a QSharedPointer. I'm probably missing something. > > Does anyone know of a code base that makes liberal use of QESDP, or > could you share how you're making use of it? > I use the explicit variant for the same thing as the implicit, thus all consideration apply, with the minor exception that I have manual control over the data copying. I hope that helps. Kind regards.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest