On Jul 10, 2013, at 10:45 AM, Namespace <rswhi...@googlemail.com> wrote:

>> A string in D, and all arrays, is a struct looking like this:
>> 
>> struct Array (T)
>> {
>>    T* ptr;
>>    size_t length;
>> }
> 
> I always thought it looks like this:
> 
> struct Array(T) {
>    T* ptr;
>    size_t length, capacity;
> }

Sadly, no.  The only way to determine the capacity of an array is to query the 
GC.

Reply via email to