On Wednesday, 27 September 2017 at 07:41:23 UTC, Ilya Yaroshenko
wrote:
I would prefer outer operator overloading be added to D instead
of type wrappers. So a user can import a library for
operations, rather then library of wrappers. --Ilya
This might be a step in the right direction. It doesn't need to
be full-blown extension methods/partial classes. Just the ability
to treat operator overloading like free-standing functions (with
power of UFCS). Something like:
struct Foo
{
int data;
}
Foo opBinary!(string op)(Foo x, Foo y)
{
return mixin("x.data" ~ op ~ "y.data");
}
That would mean you could also do something like:
import lubeck : opBinary;