May 27 [Issue 24569] New: operator overloading on pointer to value-type instances | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24569 Issue ID: 24569 Summary: operator overloading on pointer to value-type instances Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: b2.temp@gmx.com Maybe this should work ```d struct S { void opOpAssign(string op, T)(T t) { } } void main() { S a; a ~= 0; // OK auto b = &a; b.opOpAssign!"~"(0); // OK b ~= 0; // NG, but maybe should ? } ``` The idea is that usually member functions are supposed to work on pointers to instances implementing these functions. -- |
Copyright © 1999-2021 by the D Language Foundation