Most elegant representation of a card's rank

bearophile bearophileHUGS at lycos.com
Mon Dec 3 16:49:34 PST 2012


deed:

> And using enum Rank { two, three, four, ... , K, A } is not 
> elegant.

But it's strongly typed, so it's safere. It's my preferred 
solution for a problem like this.


> I'd like to be able to call foo(Rank rank) with foo(3) and 
> foo(Q).

Then use module level compile-time constant...

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list