class CardPile { public: ... virtual int canTake(Card *); ... }; class SuitPile : public CardPile { public: ... virtual int canTake(Card *); ... };