title: Forward Declare a Subclass
body: <p>I have a Base class A in a header file A.h</p>
  
  <pre><code>class A{};
  </code></pre>
  
  <p>in A.cpp I have several subclasses:</p>
  
  <pre><code>class B: public A{};
  class C: public A{};
  </code></pre>
  
  <p>I would like to instantiate types B and C in a separate file but I can't see how unless I include A.cpp in my other files.  If I forward declare B and C in A.h like this:</p>
  
  <pre><code>class B;
  class C;
  </code></pre>
  
  <p>Then the instantiating class doesn't know its derived from A.  How would I solve this issue?</p>
  
  <p>Thanks,
  Eric</p>