I understand how Enums work in C#, and I get what the Flags attribute brings to the table.
I saw this question, here. Which recommends the first flavor, but doesn't provide any reason/justification for it.
Is there a difference in the way in which these two are defined, is one better than the other? What are the advantages to using the first synax as instead of the second? I've always used the second flavor when defining Flags type Enums... have I been doing it wrong all this time?
[Serializable]
[Flags]
public enum SiteRoles
{
User = 1 << 0,
Admin = 1 << 1,
Helpdesk = 1 << 2
}
Is that not the same as
[Serializable]
[Flags]
public enum SiteRoles
{
User = 1,
Admin = 2,
Helpdesk = 4
}