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

List:       kde-core-devel
Subject:    Re: thoughts about BIC
From:       Lubos Lunak <l.lunak () email ! cz>
Date:       2002-03-30 20:00:53
[Download RAW message or body]

On Fri 29. March 2002 15:01, Rolf Magnus wrote:
> I was wondering if adding member variables always is BIC. Sure, it changes
> the size of the object (and if you don't append them to the end, the
> layout), but where is this size needed? AFAIK only on creation of the
> object, because the system needs to know how much storage to get for it.
> But if the allocation of storage is only done in the library that contains
> the class (e.g. for singletons or objects that are only created through a
> factory), this should not matter, right? So can member variables be added
> to such a class without making it BIC (if you don't let inline methods
> access them of course)?

 If you

 - 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

 then I think yes (preferably after checking twice ;)  ).

-- 
 Lubos Lunak
 llunak@suse.cz ; l.lunak@kde.org
 http://dforce.sh.cvut.cz/~seli


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

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