Interesting rant about Scala's issues

Walter Bright newshound2 at digitalmars.com
Thu Apr 3 21:31:40 PDT 2014


On 4/3/2014 7:19 PM, bearophile wrote:
> I have asked for fully typesafe enums in D,

You can do this:

    struct MyInt {
        int x;
        alias this x;
        ... put your various constraints here ...
    }

to get typesafe enums. In fact, you can use this construct to create a type that 
overrides selected behaviors of any other type.


More information about the Digitalmars-d-announce mailing list