title: Private inheritance hides base class with "inaccessible within this context" error
body: <p>I'm having a problem similar to that described in <em><a href="http://bytes.com/topic/c/answers/164246-private-inheritance-renders-class-inaccessible" rel="nofollow noreferrer">Private inheritance renders class inaccessible</a></em> where a privately inherited base class gives an &quot;inaccessible within this context&quot; error when I try to declare a member of the base class inside the derived class.</p>
  <p>Explicitly referencing X with ::X works in the above case, but what if the code is in a function such as:</p>
  <pre><code>void fooby()
  {
      class X {};
  
      class Y : private X {};
  
      class Z : public Y
      {
      public:
          X x; // Compiler &quot;inaccessible within this context&quot; error
      };
  };
  </code></pre>
  <p>How do you reference X in this case?</p>
  <p>If <em>fooby</em> were a struct/class, then ::fooby::X would work, but I'm not sure how to do it in the case above.</p>