Should this be correct behaviour?

BCS ao at pathlink.com
Thu Nov 29 12:40:29 PST 2007


Reply to Walter,

> Janice Caron wrote:
> 
>> float[] f = new float[1];
>> float[] g = f.dup;
>> assert(f == g); /* Passes */
>> 
>> My question is, shouldn't the first assert also fail?
>>  
> You are comparing two array *references* which point to the same
> array. 

That dup should have copied. The references should not be equal.





More information about the Digitalmars-d mailing list