On Friday, 16 March 2018 at 01:45:57 UTC, psychoticRabbit wrote:
On Thursday, 15 March 2018 at 18:39:08public 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.
