SmartPointerList

Olivier Goffart ogoffart at bepointbe.be
Wed Jan 13 17:19:27 GMT 2010


Le Wednesday 13 January 2010, André Wöbbeking a écrit :
> On Wednesday 13 January 2010, Thiago Macieira wrote:
> > Em Quarta-feira 13 Janeiro 2010, às 00:07:01, Ingo Klöcker escreveu:
> > > Thanks a lot for the explanation, Thiago! It's very much
> > > appreciated. I guess tomorrow I'll write a bug to replace all
> > > QPointers by QWeakPointers once we depend on Qt 4.6. (No, I'm not
> > > talking about KDE. :-) )
> >
> > Remember that QWeakPointer has no operator-> by default.
> >
> > That's a protection mechanism, because QWeakPointer doesn't guarantee
> > that the pointer will remain valid.
> 
> QPointer also doesn't have that guarantee but it has operator->. What is
> the difference?

So QPointer does not have the protection.

I would personally say the arrow and the automatic cast a are convenience, but 
not that's not the opinion of everyone apparently :-) 





More information about the kde-core-devel mailing list