How to override opCmp when two different sorts are needed?

Deewiant deewiant.doesnotlike.spam at gmail.com
Wed Aug 15 06:01:09 PDT 2007


Frits van Bommel wrote:
> Deewiant wrote:
>> - Almost no D support, as you say. For instance, slices:
>>
>> array[x .. x + y]
>> array[x..$][0..y]
>> array[0..y][x..$]
>> (&array[x])[0..y]
>>
>> The above forms are equivalent, yet generate very different code.
> 
> The third one is actually equivalent to array[x..y] and not to the other
> three.

Good catch, you're right. It should of course be array[0..x+y][x..$].

I prefer the second form, anyway.

-- 
Remove ".doesnotlike.spam" from the mail address.



More information about the Digitalmars-d mailing list