On Monday, 5 July 2021 at 13:10:55 UTC, Rekel wrote:

````

But what do you do when you have?:
```d
void function(int[] a){
    . . .
    long index = countUntil(a, element);
    a.remove(index);
}
```


```d
void function(ref int[] a) {
    ...
}
```

An array is effectively a length/pointer pair that you are passing by value. If you want to do anything that affects either property, you need to pass by ref.

Reply via email to