UFCS and operator overloading

Jens Mueller jens.k.mueller at gmx.de
Mon May 7 10:06:12 PDT 2012


Hi,

from my understanding UFCS is supposed to work with operator overloading. I.e.
in the following a + b should work

struct Foo {}

Foo opBinary(string op)(Foo lhs, Foo rhs) if (op == "+")
{
    return Foo.init;
}

unittest
{
    Foo a, b;
    a + b; // fails to compile
}

Is UFCS supposed to work with operator overloading, isn't it?

Jens


More information about the Digitalmars-d mailing list