protected d-pointers

Matthias Kretz kretz at kde.org
Wed Feb 6 22:03:21 GMT 2008


Hi,

I suggest we require kdelibs classes to only use protected d-pointers so that 
the shared-d-pointer pattern can be used when needed. Once we need to keep BC 
on Windows we cannot change private members to protected members anymore. So 
we can still do this now...

OTOH one can always add a

protected:
	ClassNamePrivate *d_hack() { return d_ptr; }
	const ClassNamePrivate *d_hack() const { return d_ptr; }

to the class in order to give protected access to the d_ptr.

If you agree, the krazy check would need to be changed to report 
private/public d-pointers as incorrect and 
http://techbase.kde.org/Policies/Library_Code_Policy#D-Pointers would need to 
get an update.

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080206/b28d9ed3/attachment.sig>


More information about the kde-core-devel mailing list