Getting Field Names of a specific UDA in compile time.
real_het at hotmail.com
Sat Oct 3 13:10:31 UTC 2020
@("NODES") int gem1, gem2, gem3, gem4, gem5, head1, head2,
import std.traits, std.meta;
alias Nodes = getSymbolsByUDA!(typeof(this), "NODES");
enum NodeNames = ["gem1", "gem2", ....];
Is there a way to make an enum like the above with compile time
I only managed to get the string by making a static foreach,
but I don't know how to put that in an enum xxx = ...; statement.
More information about the Digitalmars-d-learn