I have an extension method that accepts a parameter T
. This parameter is a numeric type, one of the following: byte, short, int and long.
I need to check if T
equals to 0. How is it possible to do that?
public static void WriteFlaggedValue<T>(this OutPacket outPacket, uint flag, T value, ref uint outputFlag) where T : struct,
IComparable,
IComparable<T>,
IConvertible,
IEquatable<T>,
IFormattable
{
if (value == 0)
{
}
}