#
A nested class is a member and as such has the same access rights as any other member.
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 1: class E { int x; class B { }; class I { B b; / OK, E​::​I can access E​::​B int y; void f(E* p, int i) { p->x = i; / OK, E​::​I can access E​::​x } }; int g(I* p) { return p->y; / error: I​::​y is private } }; — end example]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant