protected d-pointers

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


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

	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 would need to 
get an update.

Matthias Kretz (Germany)                            <><
MatthiasKretz at, kretz at,
Matthias.Kretz at
-------------- 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: <>

More information about the kde-core-devel mailing list