Say I've two enums:
const Foo = enum {
One,
Two,
};
const Bar = enum {
Red,
Green,
};
Now suppose I want to create some further configuration for each pair combination, like: (One, Red) = 10, (One, Green) = 11, (Two, Red)=22, and (Two, Green)=83 [Values are arbitrary and there isn't a formula for them]
What is the best way to build this?
I could try doing some [2][2]u8 at comptime? But not sure if there's a good way to be sure thing won't compile if some elements gets added to Foo or Bar.
I could make 2 be at least calculated at comptime, but I also want to make sure that element is properly assigned.