C#C
C#12mo ago
hugeman

return Object<byte> after checking typeof(T) == typeof(byte)

Is this possible or is there a way to sort of do this? I'm trying to do something like this:
if (typeof(TValue) == typeof(sbyte)) {
    return new MyObject<sbyte>(defaultValue, getValue, setValue, (x) => sbyte.Parse(x));
}
Was this page helpful?