title: Can't downcast because class is not polymorphic?
body: <p>Is it possible to have inheritance with no virtual methods? The compiler is saying that the following code is not polymorphic.</p>
  <p>Example:</p>
  <pre><code>class A {
  public:
      int a;
      int getA(){return a;};
  }
  
  
  class B : public A {
  public:
      int b;
      int getB(){return b;};
  }
  </code></pre>
  <p>In another class we are trying to downcast from an <code>A</code> object to a <code>B</code> object:</p>
  <pre><code> A *a = ...;
   B *b = dynamic_cast&lt;B*&gt;(a)
  </code></pre>
  <p>but this gives the following compile-time error:</p>
  <pre><code> cannot dynamic_cast ... (source type is not polymorphic)
  </code></pre>