On Mon, 25 Sep 2006 00:03:07 +0200, Bo Persson wrote:
> Fraser Ross wrote:
>> "Bo Persson"
>>> It is a member of outer_class, so it should have the same access
>>> rights as all the other members, like the member functions.
>>
>>
>> Can someone confirm these 2 points? Can a class, which is a type,
>> be
>> considered a member? I think that it is only proposed that a nested
>> class has access to the nesting classes privates.
>
> You are correct, it is a proposal for the next standard. I thought it
> had passed already.
>
> The current standard says (11.
:
>
> "The members of a nested class have no special access to members of an
> enclosing class".
>
> The draft for the next standard says the opposite:
>
> "A nested class is a member and as such has the same access rights as
> any other member."
>
>> It doesn't work with my compiler.
>
> It does work with my compiler!
>
> Bo Persson
Yeah, it also works with mine, but I'm suspicious on many things that work
with that particulyr compiler... For example if aou leave some setting
default following code comiples fine:
for (int i = 0; i < 10; ++i) {
...
}
....
i = 12;
....
(The scope of i is not forced to for loop by default)
Now, this is just an example...Compilers should not be trusted when
checking is some bahvior standard or not.