title: private typedef visible in derived class
body: <p>I have a small problem with my compiler (VC++ 6.0). In my opinion, such a code should cause error;</p>
  
  <pre><code>class Base
  {
      private:
          typedef int T;
  };
  
  class Derived : private Base // Here the Base class can be inherited publicly as well. It does not play any role
  {
      public:
          T z;
  };
  
  
  
  int main()
  {
      Derived obj;
      obj.z = 7;
      return 0;
  }
  </code></pre>
  
  <p>This code snippet is compiled and run under VC++ 6.0 without any problem.</p>
  
  <p>Regarding SW-Design, this code is not perfect. None of the class member members should be declared as public. But I am not interested in this aspect.</p>
  
  <p>My problem is with typedef. The typedef is declared in Base class as private. From my point of C++ understanding, this typedef must not be visible either to Derived class or to main() function. But both see them perfectly.</p>
  
  <p>Does anybody have an explanation to this phenomenon?</p>
  
  <p>Thanks in advance</p>
  
  <p>Necip</p>