title: Where to define static const member variables of a template class
body: <p>According to this <a href="https://stackoverflow.com/q/2605520/368599">question's</a> <a href="https://stackoverflow.com/questions/2605520/c-where-to-initialize-static-const/2605559#2605559">answer</a>:</p>
  
  <p><code>According to the standards you must define i</code> <em>(which is a static const member)</em> <code>outside of the class definition</code></p>
  
  <p>... but if I do that for static const member variables of a template class which are themselves generic, then I get linking errors (similar to getting linking errors if the template code is in a separate compilation unit). If I define them in the header, the linking errors disappear (I asked whether it was OK to define them in a <code>generic</code> way in the first place in <a href="https://stackoverflow.com/q/6397330/368599">this question</a>). </p>
  
  <p><strong>Is what I am doing, safe?</strong> Below is one of the definitions of a static const member variable which is in the header.</p>
  
  <pre><code>  template&lt;typename T, unsigned int T_Size&gt; 
    const Vector&lt;T, T_Size&gt; Vector&lt;T, T_Size&gt;::Zero = Vector&lt;T, T_Size&gt;(0);
  </code></pre>