[D1] struct opEquals questions

bearophile bearophileHUGS at lycos.com
Thu Mar 18 05:37:40 PDT 2010

> My opEquals takes an Vec2 and not a *Vec2, is this wrong?

It's OK. D1 docs say:
Structs and unions (hereafter just called structs) can provide a member function:
int opEquals(S s)
int opEquals(S* s)

> Why is return value of the rotate function compared and not the rotated struct literal?

You can add a  return this or return *this at the end of the rotate method.


More information about the Digitalmars-d-learn mailing list