slice.pack!p returns Slice!(kind, [N - p, p], Iterator)
import mir.ndslice.slice: sliced, Slice; auto a = iota(3, 4, 5, 6); auto b = a.pack!2; static immutable res1 = [3, 4]; static immutable res2 = [5, 6]; assert(b.shape == res1); assert(b[0, 0].shape == res2); assert(a == b.unpack); assert(a.pack!2 == b); static assert(is(typeof(b) == typeof(a.pack!2)));
Creates a packed slice, i.e. slice of slices. Packs the last P dimensions. The function does not allocate any data.