title: C++: can't pass an object instance to another class because of the #include loop
body: <p>Let's say I have 2 classses:</p>
  
  <pre><code>// a.h
  #ifndef A_H
  #define A_H
  
  #include "b.h"
  
  class A {
    public: void a() {
      B* b = new B(this);
    }
  }
  
  #endif
  
  
  // b.h
  #ifndef B_H
  #define B_H
  
  #include "a.h"
  
  class B {
    public: B(A* a) {
       // ...
    }
  }
  
  #endif
  </code></pre>
  
  <p>This code will raise error <code>A has not been declared</code> because class A references class B, which in turn references class A that hasn't been declared in a.h yet.</p>
  
  <p>So how can I pass an instance of A to B?</p>