J
John Harrison
The following example (adapted from standard, section 11.8.1)
class E
{
int x;
class I
{
void f(E* p, int i)
{
p->x = i; // error
}
};
};
is illegal because nested class I has no special access to enclosing class
E. E::x is private and therefore p->x is an access error.
Yet Comeau C++, gcc 3.2 and Visual C++ 7.1 all compile it. What is going on?
Has the standard changed recently?
john
class E
{
int x;
class I
{
void f(E* p, int i)
{
p->x = i; // error
}
};
};
is illegal because nested class I has no special access to enclosing class
E. E::x is private and therefore p->x is an access error.
Yet Comeau C++, gcc 3.2 and Visual C++ 7.1 all compile it. What is going on?
Has the standard changed recently?
john