How to override opCmp when two different sorts are needed?
Regan Heath
regan at netmail.co.nz
Wed Aug 15 06:32:13 PDT 2007
Deewiant wrote:
> 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.
I prefer the first form, I find the rest confusing.
Regan
More information about the Digitalmars-d
mailing list