One of the most awaited features of Microsoft .NET 2.0 is generics. Generics promise to increase type safety, improve performance, reduce code duplication and eliminate unnessecary casts. The most obvious application of generics in the framework class library are the generic collections in the new System.Collections.Generic namespace. Much has been written about those, but they are not the topic of this article.
Permalink for comment
To read all comments associated with this story, please click here.
The IArithmetic<T> proposal would not require any changes to the constraint syntax. It would just require the base data types to implement another interface in addition to IComparable<T>.
I already came up with the IntCalculator approach, but since it involves a method call that is currently not inlined it is much too slow for my application (complex numbers and vectors).
But it is nice to know that you at microsoft are at least thinking about the problem.
The IArithmetic<T> proposal would not require any changes to the constraint syntax. It would just require the base data types to implement another interface in addition to IComparable<T>.
I already came up with the IntCalculator approach, but since it involves a method call that is currently not inlined it is much too slow for my application (complex numbers and vectors).
But it is nice to know that you at microsoft are at least thinking about the problem.