[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: thoughts about BIC
From:       Michael Matz <matz () kde ! org>
Date:       2002-04-08 12:49:02
[Download RAW message or body]

Hi,

On Mon, 8 Apr 2002, Lubos Lunak wrote:

> > >  - prevent others from creating instances of the class(no public
> > > constructor, including copy ctor)
> > >  - prevent others from subclassing it(not even a protected constructor)
> > >  - prevent others from direct access to any data member(you should have
> > > all data members at least protected: anyway), including inlines
> >
> > ... if an instance of such a class A is a member of another class B,
> > extending A will break B by moving it's members just as if you added a
> > member variable in the middle of B.  Yes, it's a special case of the above
> > non-instanceability.
>
>  But as you say, this is 1) in the list above, so it's no problem.

I wanted to mention it anyway, partly because 1) is a fairly harsh
prerequisite.  Instanciating class A on the stack or heap is perfectly
fine, even if A is extended by some members.  It's just non-final usage,
i.e. as base class or as member, which makes problems.


Ciao,
Michael.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic