I was somehow surprised that the following code compiles and runs (vc2012 & gcc4.7.2)
class Foo { struct Bar { int i; }; public: Bar Baz() { retu
Access control is applied to names. Compare to this example from the standard:
class A { class B { }; public: typedef B BB; }; void f() { A::BB x; // OK, typedef name A::BB is public A::B y; // access error, A::B is private }