"bearophile" <bearophileh...@lycos.com> wrote in message news:i5p63u$2pl...@digitalmars.com... > Don: >> OTOH if each member has an explicitly defined value, it's reasonable to >> perform logical operations on it. > > See my recent answer to Schveighoffer. I think that's not a fully good > idea because when you define an enum like that and you use its values as > powers-of-two flags, the type system doesn't help you enforce it is a true > combination of the flags instead of a generic number (and you may put bugs > when you define the values to assign to the flags), so I think something > like a std.bitmanip.flagset that produces a struct is better when you need > to define a flag set. >
I think all the discussions we've had about enum make it clear that enum suffers from a bit of an identity crisis. It doesn't know what it is and ends up being mediocre at everything it dabbles in.