about kde4's smart pointer

Bart Coppens kde at bartcoppens.be
Tue Oct 3 21:47:23 BST 2006


On Tuesday 03 October 2006 22:14, Adriaan de Groot wrote:
> I'd like to focus on the explicitness of the constructor:
>
> 501697    hermier     inline explicit KSharedPtr( T* p )
>
> is that or is that not a good idea for this kind of shared pointer? I'd
> like comments from people who know something about the intended use of such
> pointers (the change has been in there for a long time though).
Well, from ksharedptr.h's apidox:
' * This struct emulates C++ pointers virtually perfectly.
 * So just use it like a simple C++ pointer.'
IMO using explicit here makes it not a 'virtually perfect' emulation of 
regular pointers. (And it may have been there a long time, but I only svn 
up'ed in kde4 today to look at forwardporting my Krita 1.6 stuff, which isn't 
made easier with this (on top of the other cosmetic changes).)

Bart Coppens




More information about the kde-core-devel mailing list