I want to be able to something like this:
class A<T1, T2>
{
public void Call(T1 arg1, T2 arg2)
{
B b = new B();
b.DoSomething(arg1); // determine which overload to use based on T1
b.DoSomething(arg2); // and T2
}
}
class B
{
public void DoSomething(int x)
{
// ...
}
public void DoSomething(float x)
{
// ...
}
}
I know it can be done with an if/else check, but that doesn't seem very elegant, especially when I have 20+ types to choose from.