The developer of my project completed the following enumeration
[Flags] public enum Permissions { Overview = 1, Detail = 3, Edit = 7, Delete = 31, Block = 39,
Now, as you can see, he did, for example, Details = 3 . The reason he did this is because the Details (which should have been 2) also include a review (2 + 1 = 3).
I always thought that the way to do this is to use powers of 2 in the enumeration and do some operations and do outside the enumeration. What's going on here?
source share