title: error: member access into incomplete type : forward declaration of
body: <p>I have two classes in the same .cpp file: </p>
  
  <pre><code>// forward
  class B;
  
  class A {       
     void doSomething(B * b) {
        b-&gt;add();
     }
  };
  
  class B {
     void add() {
        ...
     }
  };
  </code></pre>
  
  <p>The forward does not work, I cannot compile.</p>
  
  <p>I get this error: </p>
  
  <pre><code>error: member access into incomplete type 'B'
  note: forward declaration of 'B'
  </code></pre>
  
  <p>I'm using clang compiler (clang-500.2.79).</p>
  
  <p><strong>I don't want to use multiple files (.cpp and .hh), I'd like to code just on one .cpp.</strong></p>
  
  <p><strong>I cannot write the class B before the class A.</strong> </p>
  
  <p>Do you have any idea of how to resolve my problem ? </p>