title: How to determine if a type is derived from a template class?
body: <p>How can I determine if a type is derived from a template class?  In particular, I need to determine if a template parameter has <code>std::basic_ostream</code> as a base class.  Normally <code>std::is_base_of</code> is the tool for the job.  However, <code>std::is_base_of</code> only works for complete types not class templates.</p>
  
  <p>I'm looking for something like this.</p>
  
  <pre><code>template&lt; typename T &gt;
  bool is_based_in_basic_ostream( T&amp;&amp; t )
  {
     if( std::is_base_of&lt; std::basic_ostream&lt; /*anything*/&gt;, T &gt;::value )
     {
        return true;
     }
     else
     {
        return false;
     }
  }
  </code></pre>
  
  <p>I'm sure this can be done I can't think how.</p>