Documentation of D arrays

Sebastian Biallas groups.5.sepp at spamgourmet.com
Fri Jan 12 04:36:14 PST 2007


BCS wrote:
> Reply to Sebastian,
> 
>>
>> So, new question: How to I pass T[] to foo(), so that foo() isn't
>> allowed to change the content of T[]?
> 
> T[] abc = //somthing
> 
> foo(abc.dup);
> 
> the .dup propriety does a GC memory allocation and a memcopy of the old
> array for any array.

What if the array is really big? It seems like a waste for me, to
duplicate it "just in question".



More information about the Digitalmars-d mailing list