Hi,
When I do the following
public class IAmAGeneric<T>
{
...
public T AMember (T a, T b) { return a + b; };
}
C# complains that
operator '+' cannot be applied to operands of type 'T' and 'T'
I haven't found any documentation that says this won't work but
I haven't found any that says it will. Nor an example. Is this a
limitation of C# generics? Is there a workaround?
This usage is common in C++ templates. Is this limitation because
C++ templates are like macros and C# generics are like classes
(according to the C# head honcho).
Thanks,
Gary