overring binary

Jethro via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Apr 7 23:46:14 PDT 2017


I have a custom type and I'm trying to do things like

x~1 and 1~x.

I can get x~1 no problem by overriding the op "~" but how to I 
get 1~x to convert 1 in to typeof(x)? instead of x in to 
typeof(1) so to speak?

I really want D to realize that 1~x is suppose to use ~ of x, not 
1.




More information about the Digitalmars-d-learn mailing list