title: Fold expressions maximum number of elements in expansion pack
body: <p>Please consider the following program:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  
  template&lt;typename T, std::size_t N, std::size_t... I&gt;
  T sum_impl(T (&amp;a)[N], std::index_sequence&lt;I...&gt;)
  {
    return (a[I] + ...);
  }
  
  template&lt;typename T, std::size_t N&gt;
  T sum(T (&amp;a)[N])
  {
    return sum_impl(a, std::make_index_sequence&lt;N&gt;{});
  }
  
  int main()
  {
      int a[512] = {[0 ... 511] = 1};
      std::cout &lt;&lt; "Sum =" &lt;&lt; sum(a) &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p><a href="http://coliru.stacked-crooked.com/a/69e9cc6982dcd7ca" rel="nofollow noreferrer">Demo</a></p>
  
  <p>In cases as the above, fold expressions are IMHO a good way to unfold what otherwise would have been a for loop. The questions that naturally arise are:</p>
  
  <ol>
  <li>Is there a maximum number of elements in the expansion pack of the fold expression per vendor and how we can get/access this number (e.g., in VC++2017 for some reason the maximum number is 745, otherwise the program doesn't compile)?</li>
  <li>Is there a number of elements in the expansion pack of the fold expression that if exceeded the performance is compromised. That is, is there a rule of thumb that if this number is exceeded it would have been better if we have used a for loop? </li>
  </ol>