Why was an interface for arithmetic operations aba

2019-04-24 11:26发布

In .NET it is not possible to constrain a generic method so it only accepts numeric types as described in the following question: Is there a constraint that restricts my generic method to numeric types?.

But if you look at the reference source for .NET (http://sourceof.net) and look at the source code for the primitive types (Int32, Int64, Single, etc) there is a reference to something called IArithmetic<T> with an implementation of the interface for all primitive types but the implementation has been commented out.

The definition of the interface cannot be found, but looking at the implemented methods the interface defines the required methods for a generic numerics interface.

So my question is: Why was this work abandon?

标签: c# .net clr
0条回答
登录 后发表回答