On Thursday, 5 October 2023 at 12:00:22 UTC, Timon Gehr wrote:


void opIndexAssign(int value, int index){ i[index] = value; }

In this case I need to define many operator overloads. For example (+=), this won't work without returns ref:

```d
  s[1] += 3;
  assert(s.i == [2, 45]);
// Error: no `[]` operator overload for type `S`
```
SDB@79

  • opIndexAssign Salih Dincer via Digitalmars-d-learn
    • Re: opIndexAssign Timon Gehr via Digitalmars-d-learn
      • Re: opIndexAssign Salih Dincer via Digitalmars-d-learn

Reply via email to