title: Unpacking variadic template arguments into array applying function for each type
body: <p>I have a problem  with the following code</p>
  
  <pre><code>template&lt;typename... TArgs&gt;
  void SomeFunc() {
     Foo* data[] = {
       Func&lt;TArgs&gt;()..., // &lt;- expand the pack into array but calling Func for each type
       nullptr
     };
  }
  </code></pre>
  
  <p>Func of course returns Foo* instance.</p>
  
  <p>The nullptr at the end is for the case if TArgs is empty so that the array has size is never zero but despite this fact when compiling the code and instantiating SomeFunc with empty template argument list I get:</p>
  
  <pre><code>cannot allocate an array of constant size 0
  </code></pre>
  
  <p>like the nullptr element was never there. If I change the declaration of the array to:</p>
  
  <pre><code>Foo* data[sizeof...(TArgs) + 1] = 
  </code></pre>
  
  <p>The error message changes too:</p>
  
  <pre><code>Error   2   error C4789: buffer 'data' of size 8 bytes will be overrun; -4 bytes will be written starting at offset 8
  </code></pre>
  
  <p>What am I missing ? If someone could please enlighten me because I am clearly hammering this problem for too long and probably don't see the main issue here.</p>