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

List:       kde-devel
Subject:    Re: accessing protected members of a parent class
From:       Lubos Lunak <l.lunak () sh ! cvut ! cz>
Date:       2002-04-04 18:08:08
[Download RAW message or body]

On Thu 4. April 2002 19:56, Roberto Alsina wrote:
> On Thu, 4 Apr 2002, Ellis Whitehead wrote:
> > On Thursday 04 April 2002 11:40, Patrick Julien wrote:
> > > you have to make B a friend in the protected or private section of
> > > class A.
> >
> > That is in fact what I've been doing to get around the problem.  But its
> > ugliness quotient is horrendous and you can only use this approach for
> > sub-classes which you program yourself -- leaving the option unavailable
> > to programmers using the library...
>
> Ok, the real answer is: "you are not supposed to access protected members
> of the parent class".
>
> If the guy that designed the class wanted you to access that member, he
> would have made the member public.

 You should probably tell the ANSI/ISO C++ guys that they have one 
superfluous keyword in C++. Otherwise, if 'you are not supposed to access 
protected members of the parent class', why should there be a keyword that 
lets one access protected members of the parent class?

[snip]

-- 
 Lubos Lunak
 llunak@suse.cz ; l.lunak@kde.org
 http://dforce.sh.cvut.cz/~seli
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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