Of the two methods below, which do you prefer to read?
Is there another (better?) way to check if a flag is set?
bool CheckFlag(FooFlag fooFlag)
{
return fooFlag == (this.Foo & fooFlag);
}
And
bool CheckFlag(FooFlag fooFlag)
{
return (this.Foo & fooFlag) != 0;
}
Please vote up the method you prefer.