title: Defaulted parameter after parameter pack
body: <p>This is an extension of the standard <code>std::max</code> function, so it can take a random amount of arguments. </p>
  
  <pre><code>template&lt;typename T, typename U, typename Compare = std::greater&lt;&gt;&gt; constexpr
  const auto max(const T&amp; first, const U&amp; second, Compare comp = Compare())
  {
      return comp(first, second) ? first : second;
  }
  
  template&lt;typename T, typename U, typename... Pack, typename Compare = std::greater&lt;&gt;&gt; constexpr
  const auto max(const T&amp; first, const U&amp; second, const Pack&amp;... rest, Compare comp = Compare())
  {
      return comp(first, second) ? max(first, rest..., comp) : max(second, rest..., comp);
  }
  </code></pre>
  
  <p>As I understand, the <code>comp</code> parameter will take the value of the last argument with which I call the function. </p>
  
  <p>Am I wrong? What can I do about it?</p>
  
  <pre><code>std::cout &lt;&lt; max(2, 3, 4, 5); //boom
  std::cout &lt;&lt; max(2, 3, 4, 5, std::greater&lt;&gt;()); //boom
  </code></pre>
  
  <p>Of course it works fine if I remove <code>comp</code> entirely.</p>