title: Using reinterpret_cast to check inheritance at compile time
body: <p>Regarding this question: <a href="https://stackoverflow.com/questions/573294/when-to-use-reinterpret-cast">When to use reinterpret_cast?</a></p>
  
  <p>I found sth. like this:</p>
  
  <pre><code>template&lt;typename T&gt; bool addModuleFactoryToViewingFactory(ViewingPackage::ViewingFactory* pViewingFactory)
  {
   static_cast&lt;ModuleFactory*&gt;(reinterpret_cast&lt;T*&gt;(0)); // Inheritance compile time check
  
    ...
  }
  </code></pre>
  
  <p>Is this a good way to check whether <code>T</code> can be casted to <code>ModuleFactory</code> at compile time?<br>
  I mean, to check if the programmer put valid stuff into the <code>&lt;&gt;</code>of <code>addModuleFactoryToViewingFactory&lt;T&gt;(...)</code><br>
  Is this okay, good or maybe the only way?</p>
  
  <p>Greetings</p>