Benjamin Thaut <[email protected]> wrote:
If I want to tell the compiler that a certain function argument should
not be
copied (say a large struct, or a array) which is the right way to do?
arrays:
1. function foo(in float[] bar) { ... }
2. function foo(ref const(float[]) bar) { ... }
3. something else
For arrays, only the pointer and length are passed by value, the data
is passed by reference (said pointer).
structs:
1. function foo(in largestruct bar) { ... }
2. function foo(ref const(largestruct) bar) { ... }
3. something else
#2.
--
Simen