Re: ref parameter qualifier and static arrays

2015-09-10 Thread Paul via Digitalmars-d-learn
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

Re: ref parameter qualifier and static arrays

2015-09-09 Thread anonymous via Digitalmars-d-learn
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

Re: ref parameter qualifier and static arrays

2015-09-09 Thread anonymous via Digitalmars-d-learn
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

ref parameter qualifier and static arrays

2015-09-09 Thread Paul via Digitalmars-d-learn
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