OpBinaryRight

Wrap a binary operator overload.

template OpBinaryRight (
string op
lhs_t = Guess
) if (
IsPyBinary(op)
) {}

Members

Aliases

OpBinaryRight
alias OpBinaryRight = BinaryOperatorX!(op, true, lhs_t)
Undocumented in source.

Parameters

op

Operator to wrap

Bugs

Issue 8602 prevents disambiguation for case X opBinary(string op, T)(T t);

Examples

class Foo{
    int _j;
    int opBinary(string op)(int i) if(op == "+"){
        return i+_j;
    }
    int opBinaryRight(string op)(int i) if(op == "+"){
        return i+_j;
    }
}

class_wrap!(Foo,
    OpBinary!("+"),
    OpBinaryRight!("+"));

Meta