TDPL: Overloading template functions

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Jul 28 10:32:08 PDT 2010


Woops, I got confused. I was thinking about structs, not arrays.

But yeah, in this case a float gets compared to a double and it seems to
evaluate to false.

On Wed, Jul 28, 2010 at 7:26 PM, Jonathan M Davis <jmdavisprog at gmail.com>wrote:

> On Wednesday, July 28, 2010 09:49:52 Andrej Mitrovic wrote:
> > IIRC arrays are value types and as such they are compared bit-by-bit
> > to each other, right?
>
> Dynamic arrays are reference types (though static arrays are indeed value
> types), and they evaluate for equality by comparing each element in turn
> (though
> presumably, they compare their length first and don't bother with element
> comparisons if the lengths don't match). Look at section 4.1.5 on page 100
> of
> TDPL.
>
> - Jonathan M Davis
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20100728/49266597/attachment.html>


More information about the Digitalmars-d mailing list