xxxxxxxxxx
import std;
import core.stdc.stdlib;
void main() {
alias T = size_t;
enum count = 7;
enum size = T.sizeof * count;
// Allocate some memory
void* rawData = malloc(size);
// Access that data as T[]
T[] slice = (cast(T*)rawData)[0..count];
// Yet another slice of half of those
T[] half = slice[0..$/2];
// Number fill:
foreach(i, ref s; slice) s = i;
// Free the memory: free(rawData);
slice.writeln;
assert(slice[0..$/2] == half);
assert(half != slice[$/2..$]);
}