Yes, you were right:

Vector3
{
// ...
/// Binary operator for operator + and -
public Vector3 opBinary(string op) (const ref Vector3 rhs) const if (op == "+" || op == "-")
  {
mixin("return new Vector3(x" ~ op ~ "rhs.x, y" ~ op ~ "rhs.y, z" ~ op ~ "rhs.z);");
  }
// ...
}

I removed ref and it worked. I'm a bit confused by this, I'll go read up on the ref keyword.

Reply via email to