No subject


Sat Nov 15 23:40:05 PST 2008


> alias int BlockNum;
> BlockNum a = 42;
> someFuncThatTakesAnInt(a);

If you want to have a type that is an int, but which won't allow itself
to directly interact with ints, use a typedef.

Personally, I like this usage for simple numeric values which I don't
want to accidentally mix with other types.  Yes, it's a bit of a pain to
do arithmetic, but that's the trade-off you make.



More information about the Digitalmars-d-learn mailing list