Is there a way to make compound assignment operators (-=, +=, *= and friends) work with D's operator overload regime? I can't make them work.

struct Foo
{
    this( int foo )
    Foo opBinary(string op)( in typeof(this) rhv )
    if( op == "-=" )
    {
         _bar -= rhv._bar;
         return this;
    }

    private int _bar;
}

void main()
{
    au

--
Yao G.

Reply via email to