Colors in Raylib

Salih Dincer salihdb at hotmail.com
Mon Feb 28 15:00:00 UTC 2022


On Monday, 28 February 2022 at 12:18:37 UTC, Mike Parker wrote:
> ```d
> enum expandEnum(EnumType, string fqnEnumType = 
> EnumType.stringof) = (){
>     string expandEnum;
>     foreach(m;__traits(allMembers, EnumType)) {
>         expandEnum ~= "alias " ~ m ~ " = " ~ fqnEnumType ~ "." 
> ~ m ~ ";";
>     }
>     return expandEnum;
> }();
> ```
>
> Then you can mixin aliases for any named enum members you'd 
> like:
>
> ```d
> mixin(expandEnum!Colors);
> ```

It definitely works, thank you.


More information about the Digitalmars-d-learn mailing list