On Monday, 29 June 2015 at 22:05:47 UTC, qznc wrote:
Something like this:
enum X { A, B, C };
enum Y { foo, bar, baz };
alias both = TwoEnums!(X,Y);
static assert(both.sizeof == 1);
both z;
z.X = B;
z.Y = bar;
that's so easy that it's not even funny...
enum X { A, B, C };
enum Y { foo, bar,
I stumbled upon this interesting programming challenge [0], which
imho should be possible to implement in D. Maybe someone here
wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient accessor functions.
Something like this:
enum X { A,
On Monday, 29 June 2015 at 22:05:47 UTC, qznc wrote:
I stumbled upon this interesting programming challenge [0],
which imho should be possible to implement in D. Maybe someone
here wants to try.
Task: Given two enums with less than 256 states, pack them into
one byte and provide convenient ac