On Thursday, 1 July 2021 at 20:23:41 UTC, Ben Jones wrote:
I tried to to write 2 versions of opIndex:
```
public Type opIndex(IndexType x) const {... }
//and
private Type ref opIndex(IndexType x) { ... }
```
which doesn't seem to work because client code that has a
non-const reference to my
I have a struct which I would like to have a public opIndex which
returns by value (so client code can't modify my internal array),
and a private version which allows the implementing code to
modify stuff with `this[whatever] = whatever`.
I tried to to write 2 versions of opIndex:
```
public