title: C++ error: default template arguments may not be used in function template
body: <p>I am trying to understand what the value = T() means and how to fix it. Also the function is a constructor for a class.</p>
  
  <pre><code>template&lt;typename T&gt;
  Accumulator&lt;T&gt;::Accumulator(const T&amp; value = T())
  {
       total = value;
  }
  </code></pre>
  
  <p>This does not compile the following errors are:</p>
  
  <pre><code>error: default argument given for parameter 1 of `Accumulator&lt;T&gt;::Accumulator(const T&amp;)'
  error: after previous specification in `Accumulator&lt;T&gt;::Accumulator(const T&amp;)'
  </code></pre>
  
  <p>Basically the function is a constructor for a class with a default argument that sets "total" a private variable of my class to "value" if given a value for an argument.</p>