Lossless Bidirectional Enum-Conversions Mixin

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


On Sunday, 7 September 2014 at 17:22:38 UTC, Nordlöw wrote:
> BidirectionalEnums(
>     "x", "a",
>     "y", "b",
>     "z", "c",
> );

The enumeration names must of course be given aswell:

BidirectionalEnums2(
     "A", "B",
     "x", "a",
     ...
);

and two specifies the number of enums involved.

We could of course also use

BidirectionalEnums(
     tuple("A", "B"),
     tuple("x", "a"),
     ...
);

for more verbosity.


More information about the Digitalmars-d-learn mailing list