What you are saying is that the type of T should be an
IComparable
of itself (
int
is an
IComparable<int>
) and that type T should also be an
IGetBytes
of <T>.
Int32 on MSDN[
^] shows that the
int
structure is no
IGetBytes<int>
so it can not be used as type T here.
Look at Shmuel Zangs answer for a workaround. Although I am not sure you should use
MyWrapperClass<T>
because the implementation of
IComparable
and
IGetBytes
probably won't be generic for all types... Rather just create a
MyIntWrapper Class
.