Eran Kampf
Eran Kampf
1 min read

Generic numerics with .NET

I’ve been playing with .NET generics trying to find a way to convert the current Sharp3D.Math structures to be generic templates.

The problem with .NET generic templates and numerics code is that there is no way to constraint a type parameter to require the existence of static method that we require for calculations (arithmetic operators etc.)

I found a very good workaround in this article.

Though I do not plan on converting Sharp3D.Math to use generics any time soon I assume I will use this solution when the time to move to .NET 2.0 comes…