[Issue 346] New: 'is' operator inconsistant with arrays

Jarrett Billingsley kb3ctd2 at yahoo.com
Tue Sep 12 21:50:40 PDT 2006


<d-bugmail at puremagic.com> wrote in message 
news:bug-346-3 at http.d.puremagic.com/issues/...
> http://d.puremagic.com/issues/show_bug.cgi?id=346

> It has been my understanding that the 'is' operator, when working with 
> types
> other than objects, is an alias for the '==' operator.  (For template
> simplicity, as I recall.)  However, the following code illustrates a case 
> where
> it is different in behavior.  (My apologies if this is not really a bug, 
> but I
> don't know what else to call it.)

I'd say that this is proper, but just a fuzzy area.  == compares the values 
of the arrays, and 'is' sees if the array references refer to the same data. 
The same way as class instances: == compares the values (using opEquals), 
and 'is' sees if they point to the same instance. 





More information about the Digitalmars-d-bugs mailing list