That way you could make methods that accept numbers as parameters, not making overloads for every possible type.
So if anyone knows the reason, or knows a way to make methods that accept all numbers while not making overloads for every type, please post feedback. I'm really curious.
UPDATE: Or why isn't there a interface called INumber, then you could do something like this:
public void Method<T> where T : INumber()
{
}
So yeah, I'm not sure why isn't there something like this in the .NET... If anyone knows please tell...
This post has been edited by RexGrammer: 02 January 2012 - 12:41 PM

New Topic/Question
Reply



MultiQuote







|