title: Unpacking Parameter Pack in C++
body: <p>I have two functions <code>f</code> and <code>g</code>. <code>f</code> calculates it's return value asynchronously and returns a future. Now, based on several return values of <code>f</code>, I want to call <code>g</code>, but I want to make sure that the computations of the values of <code>f</code> happen in parallel.</p>
  
  <p>Consider the following code:</p>
  
  <pre><code>template &lt;typename T&gt;
  std::future&lt;T&gt; f(T&amp; t);
  
  template &lt;typename... T&gt;
  void g(T&amp;&amp;... t)
  
  template &lt;typename... T&gt;
  void call_wrapper(T&amp;&amp;... t) {
    auto f1 = f(t1); // How do I set the values of f1... fn
    auto f2 = f(t2);
    ...
    g(f1.get(), f2.get()....); // How do I call g
  }
  </code></pre>
  
  <p>How can I unpack the types from the variadic template <code>T</code> of the <code>call_wrapper</code> function?</p>