title: C++ Templates Error: no matching function for call std::vector<int, std::allocator<int> >
body: <p>I can't manage to figure out why I get an error for the following code:</p>
  
  <pre><code>template &lt;typename T&gt;
  class Test{
      void foo(vector&lt;T&gt;&amp; v);
  };
  
  template &lt;typename T&gt;
  void Test&lt;T&gt;::foo(vector&lt;T&gt;&amp; v){
      //DO STUFF
  }
  
  int main(){
        Test&lt;int&gt; t;
        t.foo(vector&lt;int&gt;());
  }
  </code></pre>
  
  <p>This is the error:</p>
  
  <pre><code>main.cpp: In function ‘int main()’:
  main.cpp:21:21: error: no matching function for call to ‘Test&lt;int&gt;::foo(std::vector&lt;int, std::allocator&lt;int&gt; &gt;)’
  main.cpp:21:21: note: candidate is:
  main.cpp:14:6: note: void Test&lt;T&gt;::foo(std::vector&lt;T&gt;&amp;) [with T = int]
  main.cpp:14:6: note:   no known conversion for argument 1 from ‘std::vector&lt;int, std::allocator&lt;int&gt; &gt;’ to ‘std::vector&lt;int, std::allocator&lt;int&gt; &gt;&amp;’
  </code></pre>
  
  <p>What am I doing wrong?</p>