Which operators cannot be overloaded and why not?

user1234 user1234 at 12.de
Mon Sep 13 14:47:33 UTC 2021


On Monday, 13 September 2021 at 14:33:03 UTC, user1234 wrote:
> what else ?

when you have

```d
alias AA1 = int[int];
alias AA2 = AA1[int];
```

then you can write

```d
AA2 aa;
aa[0] = [0 : 0];
aa[0][0] = 0;
```

The `[0][0]` cannot be expressed using operator overloads (and a 
custom map type that implements opIndexAssign).But this case is 
rather due to the fact that druntime seems to do something a bit 
unusal here (according to an old discussion that happend once on 
irc).



More information about the Digitalmars-d-learn mailing list