title: Removing object from vector
body: <p>I've tried something similar to <a href="http://en.wikipedia.org/wiki/Erase-remove_idiom" rel="nofollow">this</a>, but it does not work for me. Here is the code:  </p>
  
  <pre><code>void Player::remove_card_from_hand(Card* the_card){
      current_cards.erase(remove(current_cards.begin(), current_cards.end(), the_card), current_cards.end()); //Error occurs here at third argument "the_card"
  }
  </code></pre>
  
  <p>where <code>vector&lt;Card*&gt;current_cards;</code> defines the vector of pointers to Card objects.</p>
  
  <p>However, I get the error: </p>
  
  <blockquote>
    <p>C2660: 'remove' : function does not take 3 arguments</p>
  </blockquote>
  
  <p>I realize that having the_card as a pointer to an object, is what is probably calling it.
  Could someone tell me whats wrong with this code, or show me a different way of trying to remove an object from a vector of objects.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Simple problem, was missing <code>#include &lt;algorithm&gt;</code>. Now works.</p>