built-in array ptrEnd

Don Clugston dac at nospam.com
Tue Sep 18 05:02:29 PDT 2012


On 17/09/12 18:40, bearophile wrote:
> monarch_dodra:
>
>> IMO, this should really be built-in, in particular, since, in my
>> understanding, an array is internally represented by the ptr and
>> ptrEnd pair anyways.
>
> Currently this is not true, take a look at the ABI part in the D site.
> Currently it's a pointer and length. Walter and/or Andrei discussed the
> idea of turning them into two pointers, but I don't know if and why that
> change was refused.

Because it would be a mistake. You can efficiently get from (ptr, 
length) to (ptr, endPtr) but the reverse is not true.



More information about the Digitalmars-d mailing list