Re: Compile time mapping

2019-05-12 Thread Bastiaan Veelo via Digitalmars-d-learn
On Sunday, 12 May 2019 at 18:47:20 UTC, Bogdan wrote: On Sunday, 12 May 2019 at 17:53:56 UTC, Bastiaan Veelo wrote: If I understand your question correctly, you have two enums of equal length, and you want to convert members across enums according to their position, right? My question was

Re: Compile time mapping

2019-05-12 Thread Bogdan via Digitalmars-d-learn
On Sunday, 12 May 2019 at 17:53:56 UTC, Bastiaan Veelo wrote: If I understand your question correctly, you have two enums of equal length, and you want to convert members across enums according to their position, right? My question was very vague, sorry about that. In my use case I'd like to

Re: Compile time mapping

2019-05-12 Thread Bastiaan Veelo via Digitalmars-d-learn
On Sunday, 12 May 2019 at 17:53:56 UTC, Bastiaan Veelo wrote: On Saturday, 11 May 2019 at 15:48:44 UTC, Bogdan wrote: What would be the most straight-forward way of mapping the members of an enum to the members of another enum (one-to-one mapping) at compile time? If I understand your

Re: Compile time mapping

2019-05-12 Thread Bastiaan Veelo via Digitalmars-d-learn
On Saturday, 11 May 2019 at 15:48:44 UTC, Bogdan wrote: What would be the most straight-forward way of mapping the members of an enum to the members of another enum (one-to-one mapping) at compile time? If I understand your question correctly, you have two enums of equal length, and you want

Re: Compile time mapping

2019-05-12 Thread Patrick Schluter via Digitalmars-d-learn
On Saturday, 11 May 2019 at 15:48:44 UTC, Bogdan wrote: What would be the most straight-forward way of mapping the members of an enum to the members of another enum (one-to-one mapping) at compile time? An example of a Initial enum that creates a derived enum using the same element names but

Re: Compile time mapping

2019-05-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 11 May 2019 at 15:48:44 UTC, Bogdan wrote: What would be the most straight-forward way of mapping the members of an enum to the members of another enum (one-to-one mapping) at compile time? I'd probably have either a definition of one in terms of the other: enum Other { a =

Compile time mapping

2019-05-11 Thread Bogdan via Digitalmars-d-learn
What would be the most straight-forward way of mapping the members of an enum to the members of another enum (one-to-one mapping) at compile time?