getting Key:Value pairs of an enum at compile time ?
Uplink_Coder
someemail at someprovider.some
Thu Jan 23 09:59:03 PST 2014
Oh my bad
wasn't too carefull with deletion
auto EnumToSelect(Enum)(string Name = __traits(identifier,Enum))
if (is(Enum==enum)) {
foreach (i,Item;[__traits(allMembers,Enum)]) {
reslt ~= "\toption(value='"~__traits(getMember,Enum,Item)~"')
"~Item~"\n";
}
debug import std.stdio;
debug writeln(form_string);
return reslt;
}
More information about the Digitalmars-d-learn
mailing list