C#, Flags Enum, Generic function to look for a flag

后端 未结 11 1519
陌清茗
陌清茗 2020-12-30 05:43

I\'d like one general purpose function that could be used with any Flags style enum to see if a flag exists.

This doesn\'t compile, but if anyone has a suggestion, I

11条回答
  •  囚心锁ツ
    2020-12-30 06:00

    For what its worth, I recently read that this feature will be part of .NET 4.0. Specifically, it is implemented in the Enum.HasFlag() function.

提交回复
热议问题