title: converting parameter pack into a vector
body: <p>I am trying to understand variadic templates in C++ and I am lost in the following example: Imagine a function <strong>foo(T, T, T, T)</strong> which takes variadic number of arguments of the same type T and converts them into a vector. Any idea how to implement one?</p>
  
  <p>It should work like this</p>
  
  <pre><code>foo&lt;int&gt;(1,2,3,4) returns std::vector&lt;int&gt; x{1,2,3,4}
  foo&lt;double&gt;(0.1,0.2,0.3) returns std::vector&lt;double&gt; x{0.1,0.2,0.3}
  </code></pre>