Lossless Bidirectional Enum-Conversions Mixin

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 7 10:22:36 PDT 2014


Have anybody come up with some mixin magic that given

     enum A { x,y,z }
     enum B { a,b,c }

and call to a mixin

BidirectionalEnums(
     "x", "a",
     "y", "b",
     "z", "c",
);

generates two to!Enum overloads that implement bidirectional 
(lossless) conversion rules between A and B?


More information about the Digitalmars-d-learn mailing list