Disjoint slices of an array as reference

data pulverizer data.pulverizer at gmail.com
Thu Aug 20 02:40:41 UTC 2020


On Thursday, 20 August 2020 at 02:38:33 UTC, data pulverizer 
wrote:
>
> I've been thinking about this some more and I don't think it is 
> possible. An array in D is effectively two pointers either side 
> of a memory block. When you create a slice you are creating 
> another array two pointers somewhere in the same memory block. 
> A disjoint slice array would need more than two pointers - 
> which is not possible since an array only has 2.

p.s.

An array in D is either two pointers or one pointer and a length 
(I don't know which) - but the point still stands.


More information about the Digitalmars-d-learn mailing list