Re: Stop function parameters from being copied.

2010-10-07 Thread Lars T. Kyllingstad
On Thu, 07 Oct 2010 14:43:25 +, Benjamin Thaut 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(flo

Re: Stop function parameters from being copied.

2010-10-07 Thread Simen kjaeraas
Benjamin Thaut 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 ar

Re: Stop function parameters from being copied.

2010-10-07 Thread Steven Schveighoffer
On Thu, 07 Oct 2010 10:43:25 -0400, Benjamin Thaut 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[]) b