Quick Question about Nested Classes and Freind Scope
In the code below ...
Visual Studio SP1 compiles OK
Visual Studio without Sp1 throws an error
'can't access private variable bar'
The Question is is SP1 wrong?
I don't think A.bar should be available to the nested Class C, does anyone know if the C++ spec allows this?
friend class B;
private: int bar;
int y = myclassA.bar; // error in pre SP1 visual studio
Open in new window