[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: about private 'd' pointer
From: Simon Hausmann <sh () caldera ! de>
Date: 2000-08-31 8:42:37
[Download RAW message or body]
On Thu, Aug 31, 2000 at 10:35:16AM +0200, Falk Brettschneider wrote:
> Hi,
>
> Simon Hausmann wrote:
> >
> >
> > Well, the point about that d is exactly to be private! If you make it protected
> > and let inheritting classes access is, then adding/removing variables to/from the
> > structure breaks binary compatibility. (obviously)
> > (which makes the idea of the "d" void :)
> >
> > So I think what you want are simple protected member variables. Just keep in mind
> > that these are fixed then, meaning adding/removing/changing them breaks binary compatibility.
> > But that's the price for the advantage of them being shared / available for inheritting classes.
> Hmm...right. :)
> What about methods? Is the private d pointer intended to have methods
> that should be hidden to the outside world?
Well, that's up to you :-) If a certain method which you would normally make
private for example needs to be "protected" even more, then you can surely put it into
a "private d pointer" . It's probably a matter of taste.
Methods being declared private in a class can still be accessed using #define private public
hacks. But thinking about/using such hacks usually tells one that there is something wrong with
the application/library design ;-) .
Bye,
Simon
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic