title: Use 'class' or 'typename' for template parameters?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2023977/c-difference-of-keywords-typename-and-class-in-templates">C++ difference of keywords ‘typename’ and ‘class’ in templates</a>  </p>
  </blockquote>
  
  
  
  <p>When defining a function template or class template in C++, one can write this:</p>
  
  <pre><code>template &lt;class T&gt; ...
  </code></pre>
  
  <p>or one can write this:</p>
  
  <pre><code>template &lt;typename T&gt; ...
  </code></pre>
  
  <p>Is there a good reason to prefer one over the other?</p>
  
  <hr>
  
  <p>I accepted the most popular (and interesting) answer, but the real answer seems to be "No, there is no good reason to prefer one over the other."</p>
  
  <ul>
  <li>They are equivalent (except as noted below).</li>
  <li>Some people have reasons to always use <code>typename</code>.</li>
  <li>Some people have reasons to always use <code>class</code>.</li>
  <li>Some people have reasons to use both.</li>
  <li>Some people don't care which one they use.</li>
  </ul>
  
  <p>Note, however, that before C++17 in the case of <em>template template</em> parameters, use of <code>class</code> instead of <code>typename</code> was required. See <a href="https://stackoverflow.com/a/11311432/3964522">user1428839's answer</a> below. (But this particular case is not a matter of preference, it was a requirement of the language.)</p>