I have the following;
public static bool Has<T>(this System.Enum type, T value) where T : struct
{
return (((int)(ValueType)type & (int)(ValueType)value) == (int)(ValueType)value);
}
For some reason, calling this extension method is generating garbage, and I simply can't see why. Everything here is struct or values. Where is that unseen garbage? Is there some not-so-obvious boxing going on? Is there a better way to do this extension method?