R
Robert M. Gary
I'm curious what the ANSI C++ standard says about nested classes. I'm not
able to find where in the ANSI C++ standard this is addressed. The issue is
the accessibility of sibling nested classes. Example...
class A{
private:
class B{
};
class C{
MyTemplate<B> foo;
};
};
The Solaris 4.2 compiler says its a warning that C cannot access private
class B (even though its a sibling). Both the aCC (HP-UX) and the IBM (AIX)
compiler fail on this. I'm looking at page 160 of the ANSC++ spec (ISO/IEC
14882:1998(E) ) about nested classes but don't see any reference to scoping
of them. I've tried variations on friend but to no success.
-Robert
able to find where in the ANSI C++ standard this is addressed. The issue is
the accessibility of sibling nested classes. Example...
class A{
private:
class B{
};
class C{
MyTemplate<B> foo;
};
};
The Solaris 4.2 compiler says its a warning that C cannot access private
class B (even though its a sibling). Both the aCC (HP-UX) and the IBM (AIX)
compiler fail on this. I'm looking at page 160 of the ANSC++ spec (ISO/IEC
14882:1998(E) ) about nested classes but don't see any reference to scoping
of them. I've tried variations on friend but to no success.
-Robert