tags:

views:

186

answers:

0

Possible Duplicates:
How to cast an object into its type?
Solution for overloaded operator constraint in .NET generics

Hi All,

Is it possible to have a generic Addition method? something like:

public void Add<T>(T a, T b)
{
    T c = a + b;//Error
}

Actually operands '+' can not be applied to Type T. Is there any way around?