Need for (C++20) Contiguous Range

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Thu Oct 8 14:18:45 UTC 2020


On Thursday, 8 October 2020 at 14:06:18 UTC, Ola Fosheim Grøstad 
wrote:
> On Thursday, 8 October 2020 at 13:59:09 UTC, Per Nordlöw wrote:
>> On Thursday, 8 October 2020 at 13:43:01 UTC, Ola Fosheim 
>> Grøstad wrote:
>>> Optimizations that require linear memory access, like SIMD. I 
>>> believe.
>>
>> How could `isContiguousRange` be defined in D?
>
> It would probably require a new range interface where front and 
> popFront produce slices instead of elements.

Or a method slice() that return the container as a slice? In c++ 
containers have data and length, so I guess that is an option too.

But it would be more generic to have a front that it is a slice. 
Would work for btrees, deques etc.


More information about the Digitalmars-d mailing list