Reputation: 11
I wonder what the benefits of using Enum-flags instead of boolean fields (besides a better performance and cleaner code)...
Upvotes: 1
Views: 548
Reputation: 4445
I think it's good that if you use flags you won't need many boolean parameters on a method if you have to pass many values. The flags make it easier to overload the method, too.
Upvotes: 0
Reputation: 32681
Flags enumerations are used for masking bit fields and doing bitwise comparisons. They are the correct design to use when multiple enumeration values can be specified at the same time.
As metioned above it is nothing more than correct design, but i guess this is what matters the most.
Upvotes: 1