Bug 3999 and 4261

bearophile bearophileHUGS at lycos.com
Thu Sep 2 14:48:46 PDT 2010


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.

Bye,
bearophile


More information about the Digitalmars-d mailing list