On Friday, 19 April 2024 at 22:24:17 UTC, Liam McGillivray wrote:
```
template enumMixin(alias Enum) {
static foreach(m; __traits(allMembers, Enum)) static if
(!__traits(isDeprecated, __traits(getMember, Enum, m)))
{
mixin("alias "~m~" = __traits(getMember, Enum, m);");
}
Well, someone on the Discord server has been helping me attempt
this, but while I managed to get a solution that compiles without
errors, I still get the deprecation warning.
Here is what I ended up with:
```
template enumMixin(alias Enum) {
static foreach(m; __traits(allMembers, Enum))
I know that DStep generates CTFE functions to automatically make
aliases for enum members so that the can be used without the enum
name, as is done in C. DStep does it with a CTFE function, though
it should also be possible with a mixin template.
Here is my attempt so far, using a mixin