On Saturday, 3 October 2020 at 13:10:31 UTC, realhet wrote:
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.
There's always other ways but general rule: if you can get it one
way, just wrap that up in a function and call that function for
your enum initializer.
string[] your_function() {
// implementation here you already have
return it;
}
enum NodeNames = your_function();
Though with arrays btw `static immutable` tends to give better
results than `enum` since it avoids extra allocations.