title: Check if class is derived from a specific class (compile, runtime both answers available)
body: <p>It is easier to explain on an example so,</p>
  
  <pre><code>class base {
  //....
  }
  
  class derived1 : public base {
  //...
  }
  </code></pre>
  
  <p>In my library, there is a pointer of base class. The user of the library have to make classes derived from either base or derived1 and assign pointer to that class. </p>
  
  <p>How can I check what class is user-defined class derived from? </p>