Interesting question.
Since not all types support arithmetics and there is no generic operator support in .NET you must inject a type-specific operator into your generic Tableau class.
To add support for addition you can add a delegate variable to your generic class like this
public static Func<t,t,t> Addition;
which you then can invoke from a Sum function like this
public T Sum()
{
T sum = default(T);
for (int i = 0; i < cnt; i++)
{
sum = Addition(sum, tab[i]);
}
return sum;
}
Before using this method you must "teach" the class how to add the types you want to use by simply assigning the Addition function once
Tableau<int>.Addition = (a,b) => a+b;
Tableau<string>.Addition = (a,b) => a+b;</string></int>
for each type that you want to use.
I think this idea can be generalized (and improved by some encapsulation). If anyone finds it useful I may present in an article here.