What to do about dpointers

Frank Osterfeld frank at kdab.net
Sat May 19 09:52:22 BST 2007

On Saturday 19 May 2007 11:46:23 Oswald Buddenhagen wrote:
> On Friday 18 May 2007, Andreas Pakulat wrote:
> > 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?
> hmm, if a class has no private members and it is a lib class, it has no
> members at all, no? that means it is stateless which in turn means it
> should contain only static functions which in turn means it should be a
> namespace.
> ok, maybe i'm overgeneralizing, but at least it should be checked
> whether my logic applies. :)

It might also inherit state from a base class (accessible via protected method 
or whatever). Then there are no methods, but one might have the need later to 
add private members. Then having a (first unused) dpointer makes it possible 
to add them with breaking bc.

Frank Osterfeld -- frank at kdab.net
Klarälvdalens Datakonsult AB, Platform-independent software solutions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070519/7d306ed9/attachment.sig>

More information about the kde-core-devel mailing list