[class.access.nest]

# 11 Classes [[class]](./#class)

## 11.8 Member access control [[class.access]](class.access#nest)

### 11.8.8 Nested classes [class.access.nest]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/classes.tex#L5310)

A nested class is a member and as such has the same access rights as any other member[.](#1.sentence-1)

The members of an enclosing class have no special access to members of a nested
class; the usual access rules ([[class.access]](class.access "11.8 Member access control")) shall be obeyed[.](#1.sentence-2)

[*Example [1](#example-1)*: class E {int x; class B { }; class I { B b; // OK, E​::​I can access E​::​Bint 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*]
