Is there any appreciable difference between using an abstract class as a method parameter and generic parameter constrained to said abstract class?

Viewed 104

Is there any major difference between using

 public TValue SomeFunctionA<TValue>(BaseClass<TValue> bc)

over

 public TValue SomeFunctionB<TValue, TBaseClass>(TBaseClass bc)
      where TBaseClass : BaseClass<TValue>

I've done some testing, and I can't seem to find any difference. All derived classes behave as they should (override something, new something, etc.).

What about if 'TValue' is known, such as (besides now you can use operators):

 public int SomeFunctionAInt(BaseClass<int> bc)

and

 public int SomeFunctionBInt<TBaseClass>(TBaseClass bc)
      where TBaseClass : BaseClass<int>
1 Answers
Related