title: typeof(x) as a template argument?
body: <p>I have a variable <code>x</code>, declared as:</p>
  
  <pre><code>auto x = f(y);
  </code></pre>
  
  <p>where <code>f</code> is a function and <code>y</code> a variable, both defined somewhere else. Now I would like to declare a <code>std::vector</code> holding elements of the type of <code>x</code>, so I write:</p>
  
  <pre><code>std::vector&lt;typeof(x)&gt; v;
  </code></pre>
  
  <p>This results in a compiler error. A solution is to put here the explicit argument of <code>x</code>, but I think this defeats the purpose of <code>auto</code> in <code>x</code>'s declaration! So how can I use the type of <code>x</code> as a template argument, without explicitly writing the type (so that in the type changes, my code remains valid).</p>