Vision document for H1 2018

Dmitry Olshansky dmitry.olsh at gmail.com
Fri Mar 16 07:58:33 UTC 2018


On Friday, 16 March 2018 at 01:45:57 UTC, psychoticRabbit wrote:
> On Thursday, 15 March 2018 at 18:39:08
>
> public static class Utils
> {
>     public static T[] Slice<T>(this T[] arr, int start, int len)
>     {
>         T[] slice  = new T[len];
>         Array.Copy(arr, start, slice, 0, len);
>         return slice;
>     }
> }

Playing captain the obvious but this is COPY not slice. Slices in 
D share underlying array, something that C# recently recognized 
as special Span<T> class that may point to GC heap or off-heap 
memory.

D had slices since 2000s, pointing to any kind of memory.



More information about the Digitalmars-d-announce mailing list