On Wednesday, 9 September 2015 at 20:35:53 UTC, anonymous wrote:
When you pass a slice (without ref), what's actually passed is
a pointer and length. The contents are not copied. That means,
when you alter an array element, the change will be done the
original, even without ref:
Thanks both.
On Wednesday 09 September 2015 22:18, Paul wrote:
>
> Is it possible to call a function like this...
>
> void foo(ref int[] anArray)
>
> ...with slices of static arrays? I thought I might be able to use
> [0..$-1] but to no avail - I get an error like this (which is
> confusing!):
>
> (ref i
On Wednesday, 9 September 2015 at 20:18:57 UTC, Paul wrote:
Is it possible to call a function like this...
void foo(ref int[] anArray)
...with slices of static arrays? I thought I might be able to
use [0..$-1] but to no avail - I get an error like this (which
is confusing!):
Note that the up
Is it possible to call a function like this...
void foo(ref int[] anArray)
...with slices of static arrays? I thought I might be able to use
[0..$-1] but to no avail - I get an error like this (which is
confusing!):
(ref int[] anArray) is not callable using argument types (int[])
I've modi