How to iterate getSymbolsByUDA
Eko Wahyudin
eko.wahyudin at yahoo.co.id
Wed Nov 28 07:18:36 UTC 2018
static foreach(sym; getSymbolsByUDA!(A, Attr)){
writeln(sym.stringof); // print variable name "a" this what i
want
}
foreach(sym; getSymbolsByUDA!(A, Attr)){
writeln(sym.stringof); // print "sym"
}
foreach(sym; getSymbolsByUDA!(A, Attr)){
writeln(__traits(identifier, sym)); //also print "sym"
}
is there a way to get variable name using foreach like static
foreach?
More information about the Digitalmars-d-learn
mailing list