Using mixin templates for operator overloading.
Nicholas Wilson via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Aug 20 05:46:59 PDT 2017
On Saturday, 19 August 2017 at 10:16:18 UTC, Balagopal Komarath
wrote:
> Let us say I want to automatically define subtraction given
> that addition and negation are defined. I tried the following
> using mixin templates. If I simply mixin the template using
> "mixin sub;", then it gives the error
>
> [...]
Did you try changing the `: "+"` constraints to `if` constraints?
More information about the Digitalmars-d-learn
mailing list