Need for (C++20) Contiguous Range

FeepingCreature feepingcreature at gmail.com
Thu Oct 8 16:16:00 UTC 2020


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?

`frontArray`, a version of `front` that returned a slice of the 
next n elements iff there was an internal buffer already in that 
form? That would work with arrays, static buffers (sockets), ring 
buffers... Not sure if you also needed a `popFrontArray`.

I think the standard approach right now is just to define a range 
over slices.


More information about the Digitalmars-d mailing list