title: Is it possible to omit the template parameter when i have the type on the left hand side of the assignment?
body: <p>I want to write a function that returns a preallocated vector.
  Since it should work for any kind of vector, I am using a template.</p>
  <p>My question is whether it is possible to deduce the template parameter of the function call with the template parameter of the left hand side vector ?</p>
  <pre><code>template&lt;typename T&gt;
  std::vector&lt;T&gt; createVector(size_t initial) {
      std::vector&lt;T&gt; vec;
      vec.reserve(initial);
      return vec;
  }
  
  struct Foo {
  
  };
  
  int main() {
  
      //std::vector&lt;Foo&gt; foos = createVector(4); // this should work
      //auto foos = createVector&lt;Foo&gt;(4); // this should be okay, too
      std::vector&lt;Foo&gt; foos = createVector&lt;Foo&gt;(4); //duplicate Type :(
  }
  </code></pre>