Created
May 15, 2019 06:33
-
-
Save arphox/48c35e4c370941747f04659a6c9ecb34 to your computer and use it in GitHub Desktop.
Efficient enum HasFlag implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MyExtensions | |
{ | |
public static bool IsSet(this Color self, Color flag) | |
{ | |
return (self & flag) == flag; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shared on Medium, don't delete!