Operator &== for bitwise operation and enum flag checks #7857
Unanswered
formix
asked this question in
Language Ideas
Replies: 1 comment 3 replies
-
I think saving 5 characters compared to the HasFlag invocation (depending on how you format the code) is not going to cut it. Also keep in mind that HasFlag is a well-known method for the runtime, so it can actually produce the same fast code as in-line bit fiddling would produce. Your example produces the same assembly at runtime in both cases: To be honest, personally I find the HasFlag invocation more readable than the bit fiddling, even though I am a programmer with 22+ years of experience with C and C-like languages. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Usage example:
The &== would work with all int types as well.
Beta Was this translation helpful? Give feedback.
All reactions