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 modified the function declaration and used .ptr when calling it but it seems like a retrograde step for a modern language - although I suppose ref is pretty much the same thing.

In practice I'm using arrays of structs (which are of various fixed sizes and known at compile time) that are currently global in scope - something that I'd like to avoid.

I suppose I could just ask, what is the 'best' way to give access to variously sized static arrays between different modules?


Reply via email to