title: C++ Remove element from vector by value
body: <p>I've looked around, and it seems to me that the consensus answer for this problem is this method;</p>
  
  <pre><code>template &lt;typename T&gt;
  void removeByValue(vector&lt;T&gt; &amp; vec, const T &amp; val)
  {
      vec.erase(std::remove(vec.begin(), vec.end(), val), vec.end());
  }
  </code></pre>
  
  <p>However, I get the error <code>error C2660: 'remove' : function does not take 3 arguments</code> when trying to compile it. Why is it giving me this error?</p>