title: How to test whether class B is derived from class A?
body: <p>More specifically, let's say I have a class template with parameters <code>A</code> and <code>B</code>, and I would like to have a compiler error (when the template is being instantiated) if B is not derived from A.</p>
  
  <pre><code>template&lt;class A, class B&gt;
  class Foo
  {
      // static_assert(B is derived from A)
  };
  </code></pre>