UDA's for enum values?

JS js.mdnq at gmail.com
Sun Jul 14 05:33:06 PDT 2013


I would like to do something like

enum e
{
   @(string) p,
   @(int) i
}

class a
{
    mixin(generatePropertiesFromEnum!e);
}

which would produce the result

interface a
{
     @property string p();
     @property int i();
}

I can generate the properties without issue but I can't seem to 
attach properties to elements in the enum. I guess this is a 
"inverse-feature" feature of D?




More information about the Digitalmars-d-learn mailing list