Hi All,
I was surfing in the INTERNET here and there looking for the concept of the intern class concept in the C++.
Some people say that the gcc allow the inner class accessing the members of the enclosing class whereas the MVS compiler reject it.
So people, which one is correct ?
11.8 Nested classes [class.access.nest]
1 The members of a nested class have no special access to members of an
enclosing class, nor to classes or functions that have granted friend-
ship to an enclosing class; the usual access rules (_class.access_)
shall be obeyed. The members of an enclosing class have no special
access to members of a nested class; the usual access rules
(_class.access_) shall be obeyed.
[Example:]
class E {
int x;
class B { };
class I {
B b; int y;
void f(E* p, int i)
{
p->x = i; }
};
int g(I* p)
{
return p->y; }
};
[--end example]