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. > > Peter said what I was going to say. When the need to add such a method > arises, you should write a QUniquePointer. You should not shoehorn moving > into QScopedPointer thereby breaking the meaning of QScopedPointer.
Note that you should probably not use even std::unique_ptr for the case above. You probably want N3740[1] A Proposal for the World's Dumbest Smart Pointer. [1] http://isocpp.org/files/papers/n3740.pdf -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development