I'd prefer the following:
None = 0 = 0
Lathe = 1 = 1
Mill = 2 = 1<<1
P100 = 4 = 1<<2
P200 = 8 = 1<<3
P300 = 16 = 1<<4
S = 32 = 1<<5
P400 = 64 = 1<<6
... and then, in your code later on, using P400 & Lathe & Mill
instead of an extra constant P400LM
. (depending on what you like better, use the decimal or bitshift representations of the powers of two.)
If you already have a huge bunch of code depending on those enum
s and don't want to refactor, you could use
P400LM = 1<<6 | 1<<1 | 1<<0
which makes it clear what this flag is a combination of (much clearer than 67
, in my opinion.)