title: Are inner classes in C++ automatically friends?
body: <p>If I define an inner class in C++, is it automatically a friend of the class that contains it?  For example, is this legal:</p>
  
  <pre><code>class Outer {
  public:
      class Inner {
      public:
          void mutateOuter(Outer&amp; o);
      };
  
  private:
      int value;
  };
  
  void Outer::Inner::mutateOuter(Outer&amp; o) {
      o.value ++; // Legal?  Or not?
  }
  </code></pre>
  
  <p>I ask because on some compilers I've tried (VS2003) this code won't work, but I've heard at least anecdotally that it does work on some compilers.  I can't find a relevant section in the C++ spec about this, and if anyone can cite something specific that would say that it is or is not legal that would be great.</p>