title: Template format in C++
body: <p>I came across the following snippet in the implementation of a N-ary tree in a textbook, </p>
  
  <pre><code>template &lt;typename Object, int N&gt;
  </code></pre>
  
  <p>From what I understand, a template's main purpose is to provide "generality" to the code so that a particular variable can be of any type, represented via Object </p>
  
  <p>i.e if you have <code>template &lt;typename Object&gt;</code> then we may write the following in the code: <code>Object variable1;</code>, where <code>Object</code> is of any type.</p>
  
  <p>Based on my description, </p>
  
  <p>1) By specifying a particular variable type (in this case <code>int</code> for <code>N</code>) arn't we going against the main purpose of templates? </p>
  
  <p>Then...</p>
  
  <p>2)Why would we do this? Isn't it better to include the <code>N</code> variable in the constructor?</p>