In .NET, it is not possible to restrict a general method, so it accepts only numeric types, as described in the following question: Is there a restriction restricting my general method to numerical types? .
But if you look at the source of links for .NET ( http://sourceof.net ) and look at the source code for primitive types ( Int32 , Int64 , Single , etc.) there is a link to what is called IArithmetic<T> with an interface implementation for all primitive types, but the implementation has been commented out.
An interface definition cannot be found, but looking at the implemented methods, the interface defines the necessary methods for a common interface with numbers.
So my question is: why did this work go down?
svenslaggare
source share