November 07, 2013 Re: UFCS with constructors | ||||
---|---|---|---|---|
| ||||
Posted in reply to qznc | 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
|
Copyright © 1999-2021 by the D Language Foundation