[Development] Making QScopedPointer scoped (again)
Olivier Goffart
olivier at woboq.com
Wed Sep 4 07:56:25 CEST 2013
On Tuesday 03 September 2013 14:00:39 Thiago Macieira wrote:
> On terça-feira, 3 de setembro de 2013 22:50:53, Stephen Kelly wrote:
> > > QGraphicesView::addItem(QScopedPointer<QGraphicsItem> item)
> > >
> > > now you know that the the ownership is taken by the view.
> Note that you should probably not use even std::unique_ptr for the case
> above.
QGraphicsView is taking ownership, I want to be explicit about that.
> You probably want N3740[1] A Proposal for the World's Dumbest Smart Pointer.
> [1] http://isocpp.org/files/papers/n3740.pdf
QExemptPointer (or whatever name it will be) means there is no transfer of
ownership. (Arguably, a reference could be used. But we don't use references
for other reasons)
--
Olivier
Woboq - Qt services and support - http://woboq.com - http://code.woboq.org
More information about the Development
mailing list