Operator overloading in generic struct: can I create overloads for specific kinds(?) of generic?
- by Carson Myers
I'm defining physical units in C#, using generic structs, and it was going okay until I got the error:
One of the parameters of a binary operator must be the containing type
when trying to overload the mathematical operators so that they convert between different units. So, I have something like this:
public interface ScalarUnit { }
public…