On Wednesday, 21 September 2016 at 19:01:40 UTC, Timon Gehr wrote:


Basically, the rationale is: external operators cannot be used in generic code that does not import the module defining the operators.

So why not have the struct/class explicitly import external operators? You can do this currently with a separate module defining them and then the struct/class imports the whole thing. Kind of annoying, but would get the job done, no?

Alternately, you could invent some new syntax. Maybe something like

import this : Matrix plus(Matrix A, Matrix B);


Reply via email to