title: accessing private struct inside class using class member function
body: <p>Trying to write a setter function for a private structure inside a class. Haven't found a declaration method that allows access to the structure.</p>
  
  <p>The structure may not be moved outside of the class. The function must be a member of the class. Forward declarations may not be used.</p>
  
  <pre><code>class Editor
  {
  public:
      void setName ( string s );
  private:
      struct Object
      {
          string name;
      }Instance;
  }Ed;
  
  void Editor::setName ( string s )
  {
      name = s;  // no access
  }
  </code></pre>
  
  <p>==================================</p>
  
  <pre><code>class Editor
  {
  public:
      friend void setName ( Editor &amp;m , string s );
  private:
      struct Object
      {
          int name;
      }Instance;
  }Ed;
  
  void setName ( Editor &amp;m , string s )
  {
      name = s; // no access
  }
  </code></pre>
  
  <p>==================================</p>
  
  <pre><code>class Editor
  {
  public:
      friend void setName ( Object &amp;m , string s ); //invalid declaration (  Object is undefined )
  private:
      struct Object
      {
          string name;
      }Instance;
  }Ed;
  </code></pre>