Shortcomings of D-Style Fused Operator Overloading

Ahmet Sait nightmarex1337 at hotmail.com
Fri Jul 7 15:49:55 UTC 2023


On Friday, 7 July 2023 at 13:28:23 UTC, Quirin Schroll wrote:
> The last two or three are debatable; I have not put them in 
> Rewrites intentionally. As presented, the intervals don’t 
> adhere to the last two. It’s not even clear what `==` on the 
> intervals would be. It looks like the intervals are supposed to 
> represent *any value in the bounds,* which means that – unless 
> the lower and bound is the same, i.e. the interval is a single 
> number – `I == I` should actually fail.

This is exactly how I define equality (which differs from how 
math folks define it); if X and Y are intervals then the 
comparison between them must hold for all possible values of 
these intervals which means equality only holds if they converge 
on a single point on the numerical axis. Seems like the only 
definition that's useful for implementing VRP.

> The C++ proposal 
> [P0515R0](https://open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0515r0.pdf) is also a good read. It was rejected, but introduces relevant notions. Look at least at § 1.4.1 *Guidance: What we teach.*

That's an interesting read, thanks for the link.


More information about the Digitalmars-d mailing list