www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24569] New: operator overloading on pointer to value-type

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.

--
May 27