How to make a constraint on the parameters of the constructor
<p>Now I am trying to design a class for a deck of cards.
I have:
Card.h</p>

<pre><code>class Card {
public:
    enum Suit { CLUBS = 1, SPADES, HEARTS, DIAMONDS, RED_JOKER, BLACK_JOKER };
    Card(int card, Suit suit);

private:
    int _card;
    Suit _suit;
};
</code></pre>

<p>For the constructor with parameters, I am going to make a constraint on card, the range of it is 1 to 13，so I am going to write the constructor like this:</p>

<pre><code>Card::Card(int card, Suit suit) throw (int) {
    if (card &lt; 1 || card &gt; 13) {
        delete this;
        throw card;
    }
}
</code></pre>

<p>I don't think the way I write the constructor is elegant.
I also consider to add an enum for card. But it just works for this question.
What about if I need to check a value from 1 to 100000?
Could anyone give some suggestion?
Thanks a lot!</p>
