title: Making a class friend itself
body: <p><b>EDIT:</b> It looks like I'm completely misinformed. Please close this thread. Gah.</p>
  
  <p>For the record, the following compiles and works:</p>
  
  <pre><code>class ForeverAlone
  {
  private:
    int m_friends;
    HANDLE m_handle;
  
  public:
    ForeverAlone()
    {
      m_handle = CreateThread(NULL, 0, &amp;ForeverAlone::SadThread, reinterpret_cast&lt;void*&gt;(this), 0, NULL);
    }
  
    ~ForeverAlone()
    {
      if (m_handle != NULL)
        CloseHandle(m_handle);
    }
  
  protected:
    static unsigned long WINAPI SadThread(void* param)
    {
      ForeverAlone* thisObject = reinterpret_cast&lt;ForeverAlone*&gt;(param);
  
      // is there any way for me to access:
      thisObject-&gt;m_friends;
    }
  };
  </code></pre>
  
  <p>Original question: I have a static protected thread method, which I pass an object to. Can I somehow make the class <code>friend</code> itself so I can access its private members?</p>