c# Programming Glossary: enum.hasflag
Using a bitmask in C# http://stackoverflow.com/questions/3261451/using-a-bitmask-in-c-sharp of the IsSet method above already exists in .NET 4.0 Enum.HasFlag . The Set and Unset methods don't appear to have equivalents..
How can I know items is in the enum? http://stackoverflow.com/questions/3748516/how-can-i-know-items-is-in-the-enum flag return flags flag flag Alternatively you can just use Enum.HasFlag which does exactly this. For example QueryFlag qf ... if qf.HasFlag..
What is it that makes Enum.HasFlag so slow? http://stackoverflow.com/questions/7368652/what-is-it-that-makes-enum-hasflag-so-slow is it that makes Enum.HasFlag so slow I was doing some speed tests and I noticed that Enum.HasFlag.. so slow I was doing some speed tests and I noticed that Enum.HasFlag is about 16 times slower than using the bitwise operation. Does.. the bitwise operation. Does anyone know the internals of Enum.HasFlag and why it is so slow I mean twice as slow wouldn't be too bad..
|