/// <summary> /// Checks whether a flag exists. /// This function does not check for <c>FlagsAttribute</c>. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <param name="flag">An enumeration value</param> /// <returns> /// true if the bit field or bit fields that are set in flag are also set in the current instance; otherwise, false. /// </returns> public static bool HasFlag <T>(T value, T flag) where T : struct, E => EnumCompiledCache <T> .HasFlag(value, flag);