Need for (C++20) Contiguous Range

IGotD- nise at nise.com
Thu Oct 8 15:45:33 UTC 2020


On Thursday, 8 October 2020 at 14:45:47 UTC, Steven Schveighoffer 
wrote:
>
> We have arrays in D, there is no need to duplicate what C++ 
> does because they don't have a real array type.
>
> In D, you would check if the range is a dynamic array, and then 
> use ptr/length to deal with optimizations (I do this in iopipe).
>
> -Steve

Just clarify, you mean that anything that is continuous memory 
can be converted to a slice (as supposed to an array, even if the 
relationship is somewhat ambiguous is D).

So if a type with continuous memory storage is converted to a 
slice, will isDynamicArray!T also be valid for the slice?



More information about the Digitalmars-d mailing list