Vector made up of user defined type can't use vector::erase();
<p>Trying to make a simple card game program. I'm having trouble with the vector::erase(); function on a vector made of of type Card. It seems that it can't use it because there isn't an overloaded function in vector::erase(); that deals with a <code>&lt;Card&gt;</code>. This confuses me because a vector is templated. Any idea what to do?</p>

<pre><code>    #include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;

enum card_suit {SPADE, CLUB, DIAMOND, HEART};

class Card;
class Player;
class Deck;

class Card
{
    unsigned short rank;
    card_suit suit;
public:
    Card(unsigned short r, card_suit s)
    {
        rank = r;
        suit = s;
    }
    bool operator == (Card&amp; a)
    {
        if(this-&gt;rank == a.rank &amp;&amp; this-&gt;suit == a.suit) return true;
        else return false;
    }
};

class Deck
{
    std::vector&lt;Card&gt; cards;
public:
    Deck&amp; add_card(Card c)
    {
        cards.push_back(c);
        return *this;
    }

    Deck&amp; remove_card(Card c)
    {
        for(std::vector&lt;Card&gt;::iterator i=cards.begin(); i&lt;cards.end(); i++)
        {
            if(*i==c) cards.erase(cards.begin()-i);
        }
        return *this;
    }
    Deck&amp; shuffle()
    {
    }
};

class Player
{
    Deck hand;
    unsigned short points;
public:
    Player()
    {
        points=0;
    }
};


int main()
{

    return 0;
}
</code></pre>
