BCS at pathilink.com
Tue Nov 21 09:24:01 PST 2006
Sean Kelly wrote:
> Karen Lanrap wrote:
>> Why one can derive from a nested class only in the corresponding super
>> The example gives the error:
>>> super class Id is nested within Concept, not Concrete
>> But Concrete is derived from Concept and should contain the definition
>> of the class Id!
> I think this is because inner classes can access data in the private
> scope of their surrounding class, and private class data should not be
> accessible by derived classes.
Based on that argument, this shouldn't work.
private int a;
class Bar : Foo
The derived nested class would have no more access than any other code.
Yes it could access protected stuff by way of of inherited members but
that is the way things are supposed to work.
More information about the Digitalmars-d-learn