UFCS with constructors

bearophile bearophileHUGS at lycos.com
Thu Nov 7 02:24:27 PST 2013


qznc:

> Operator precedence of "." is higher than unary minus.

You are right, I didn't know it, so Typedef and constructors are 
not to blame:


double foo(in double x) {
     assert (x >= 0);
     return x;
}
void main() {
     assert(-1.foo == -1);
}


Is this a good design of the operator precedences? Is this worth 
changing/fixing?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list