What to do about dpointers

David Faure faure at kde.org
Fri May 18 12:37:34 BST 2007


On Friday 18 May 2007, Andreas Pakulat wrote:
> Hi,
> 
> I'd like to know what do you kdelibs people do wrt to classes that don't
> have private members (at the moment) and no dpointer? Do you add a
> dpointer and private class and just initialize the dpointer to 0? Whats
> the common practice for this?

Assuming this is about exported and installed classes only,
the common practice would be to add a d pointer and move all member vars
into it (the krazy check warns about a lack of d pointers, but also about member
variables). Exceptions would be if some public method needs to be inline for 
speed reasons but that's probably not the case in kdelibs (as it is in e.g. QString).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list