title: Parameter pack must be at the end of the parameter list... When and why?
body: <p>I don't get the reason for which a parameter pack must be at the end of the parameter list if the latter is bound to a class, while the constraint is relaxed if the parameter list is part of a member method declaration.</p>
  
  <p>In other terms, this one compiles:</p>
  
  <pre><code>class C {
      template&lt;typename T, typename... Args, typename S&gt;
      void fn() { }
  };
  </code></pre>
  
  <p>The following one does not:</p>
  
  <pre><code>template&lt;typename T, typename... Args, typename S&gt;
  class C { };
  </code></pre>
  
  <p>Why is the first case considered right and the second one is not?<br/>
  I mean, if it's legal syntax, shouldn't it be in both the cases?</p>
  
  <p>To be clear, the real problem is that I was defining a class similar to the following one:</p>
  
  <pre><code>template&lt;typename T, typename... Args, typename Allocator&gt;
  class C { };
  </code></pre>
  
  <p>Having the allocator type as the last type would be appreciated, but I can work around it somehow (anyway, if you have a suggestion it's appreciated, maybe yours are far more elegant than mine!!).<br/>
  That said, I got the error:</p>
  
  <blockquote>
    <p>parameter pack 'Args' must be at the end of the template parameter list</p>
  </blockquote>
  
  <p>So, I was just curious to fully understand why it's accepted in some cases, but it is not in some others.</p>
  
  <p><a href="https://stackoverflow.com/questions/13867429/why-am-i-getting-the-error-parameter-pack-f-must-be-at-the-end-of-the-templat">Here</a> is a similar question, but it simply explains how to solve the problem and that was quite clear to me.</p>