Overloading relational operators separately; thoughts?
Matthias Bentrup via Digitalmars-d
digitalmars-d at puremagic.com
Thu Sep 29 11:57:18 PDT 2016
On Thursday, 29 September 2016 at 18:38:42 UTC, Jonathan M Davis
wrote:
>
> Then you could always do something like a.myOp!"<"(b) and
> a.myOp!">="(b) if you still want to have the operator in there
> somewhere. You can name the functions whatever you want. You
> just can't use overloaded operators for it, since it would not
> be in line with what the operators are supposed to mean and be
> used for.
>
> - Jonathan M Davis
Also with mixins and a CTFE D parser you could replace the
operators by any desired function calls.
More information about the Digitalmars-d
mailing list