title: Forward declare a class's public typedef in c++
body: <p>I'm trying to simplify a bunch of header file "include spaghetti" by using forward declarations and moving #includes into the implementation file.  However, I keep coming upon the following scenario:</p>
  
  <pre><code>//Foo.h
  #include "Bar.h"
  
  class Foo
  {
  public:
    void someMethod(Bar::someType_t &amp;val);
  };
  
  //Bar.h
  .
  .
  .
  class Bar
  {
  public:
    typedef std::vector&lt;SomeClass&gt; someType_t;
  };
  </code></pre>
  
  <p>I want to remove #include "Bar.h" in as many cases as possible.  I also see the situation where the typedef in Bar.h is listed outside of the Bar class.  I'm assuming both situations can be addressed in the same manner.</p>
  
  <p>Any ideas?</p>