Overloading relational operators separately; thoughts?
Atila Neves via Digitalmars-d
digitalmars-d at puremagic.com
Sun Oct 2 12:10:22 PDT 2016
On Wednesday, 28 September 2016 at 01:18:58 UTC, Minty Fresh
wrote:
> Currently, D offers fine grained overloading for most of the
> unary and arithmetic binary operators, but at some point a
> decision was made to lump together all of the relational
> operators (and if necessary, the equality operators) into a
> single function `opCmp`.
> And while it does add a lot of convenience and consistency to
> how operators behave, it does also put a lot of limitations on
> what they can do.
>
> [...]
opCmp was a good idea.
Allowing opBinary to bypass opCmp is also a good idea.
Atila
More information about the Digitalmars-d
mailing list