title: How do I forward declare an inner class?
body: <p>I have a class like so...</p>
  <pre><code>class Container {
  public:
      class Iterator {
          ...
      };
  
      ...
  };
  </code></pre>
  <p>Elsewhere, I want to pass a Container::Iterator by reference, but I don't want to include the header file. If I try to forward declare the class, I get compile errors.</p>
  <pre><code>class Container::Iterator;
  
  class Foo {
      void Read(Container::Iterator&amp; it);
  };
  </code></pre>
  <p>Compiling the above code gives...</p>
  <pre><code>test.h:3: error: ‘Iterator’ in class ‘Container’ does not name a type
  test.h:5: error: variable or field ‘Foo’ declared void
  test.h:5: error: incomplete type ‘Container’ used in nested name specifier
  test.h:5: error: ‘it’ was not declared in this scope
  </code></pre>
  <p>How can I forward declare this class so I don't have to include the header file that declares the Iterator class?</p>