title: C++ - 2 classes 1 file
body: <p>Suppose I want something of this sort, in one <code>.cpp</code> source file:</p>
  
  <pre><code>class A {
      public:
          void doSomething(B *b) {};
  };
  
  class B {
      public:
          void doSomething(A *a) {};
  };
  </code></pre>
  
  <p>Is there anyway of doing this without splitting it into two separate files, and without receiving a compiler error (syntax error on <code>doSomething(B *b)</code>)</p>