title: Access control and static members
body: <p>I was reading about acces specifiers for static member functions, and ended up with this example from MSDN: which I think has an error.</p>
  
  <pre><code>// access_control.cpp  
  class Base  
  {  
   public:  
    int Print();             // Nonstatic member.  
     static int CountOf();    // Static member.  
  };  
  
  
  class Derived1 : private Base  
  {  
  };  
  
  class Derived2 : public Derived1  
  {  
    int ShowCount();    // Nonstatic member.  
  };  
  
  int Derived2::ShowCount()  
  {  
    // Call static member function CountOf explicitly.  
    int cCount = Base::CountOf();     // OK.  
  
    // Call static member function CountOf using pointer.  
     cCount = this-&gt;CountOf();  // C2247. Conversion of  
                             //  Derived2 * to Base * not  
                             //  permitted.  
     return cCount;  
  }  
  </code></pre>
  
  <p>So it said that this line is Ok bu it's not :</p>
  
  <pre><code>int cCount = Base::CountOf();     // OK.
  </code></pre>
  
  <p>and this is the error msg :</p>
  
  <pre><code>error C2247: 'Base::CountOf' not accessible because 'Derived1' uses 'private' to inherit from 'Base'
  </code></pre>
  
  <p>So does the error really exists or is it related to some Option that I have to add when compiling?</p>
  
  <p>Thx</p>