Nested C++ class outer members' access
<p>This code does not work (MS VS 2005),</p>

<pre><code>b-&gt;funcA();
B::iterator iter;
</code></pre>

<p>cant access protected members declared in class A.</p>

<p>If I remove class D, everything compiles nicely.</p>

<p>I wonder if it's just a bug or standard?</p>

<pre><code>class A
{
protected:
    void funcA() {  }
    class iterator {    };
};

class D {
    class B : public A {
        class C {
            B* b;
        public:
            void funcC() {
                b-&gt;funcA();
                B::iterator iter;
            }
        };
    public:
        void funcB() {
            funcA();
        }
    };
};
</code></pre>

<p>Thanks!</p>
