Listing 4 An example illustrating name lookup in a nested class derived from a nested class

 1: int i;              // 3
 2:
 3: struct A1
 4:     {
 5:     static int i;  // never
 6:     struct B1
 7:             {
 8:             int i;     // 1
 9:             };
10:     };
11:
12: struct A2
13:     {
14:     static int i;  // 2
15:     struct B2 : public A1::B1
16:             {
17:             void f();
18:             };
19:     };
20:
21: void A2::B2::f()
22:     {
23:     i = 3;
24:     }

// End of File