using traits:
```D
string enum_to_str(E)(E v) if (is(E == enum))
{
final switch (v) with(E)
{
static foreach (m; __traits(allMembers, E))
{
case mixin(m):
return m;
}
}
}
```
core.reflect is nicer than traits because you actually get to use
actual D code
But the casting is kinda ugly, and it gives me java nightmares..
so the C++ actually feels much better