P
Paul E Collins
The help file says that "bit fields [i.e. enums that have the Flags
attribute] can be combined using a bitwise OR operation, whereas
enumerated constants cannot", and yet this code works:
enum Blah { a, b, c }; // without [Flags]
....
Blah x = Blah.a | Blah.b;
So what is the purpose of the Flags attribute? I understand it's
potentially useful for reflection, so that (for example) the IDE's
IntelliSense knows which enums are meant to be combined, but does it
have no effect on compilation at all - and, if so, is that comment in
the help file incorrect?
P.
attribute] can be combined using a bitwise OR operation, whereas
enumerated constants cannot", and yet this code works:
enum Blah { a, b, c }; // without [Flags]
....
Blah x = Blah.a | Blah.b;
So what is the purpose of the Flags attribute? I understand it's
potentially useful for reflection, so that (for example) the IDE's
IntelliSense knows which enums are meant to be combined, but does it
have no effect on compilation at all - and, if so, is that comment in
the help file incorrect?
P.