template function(ElementType)(shape) that initializes slice
n-dimensional slice to refer shape and element type
new initialized slice with Initializer alias
import mir.ndslice.topology : iota; import mir.ndslice.slice : DeepElementType; // ------- // | 1 2 3 | // | 4 5 6 | // ------- auto s = iota([2, 3], 1); // ------- // | 0 1 2 | // | 3 4 5 | // ------- auto e = s.like!iota; static assert(is(typeof(e) == typeof(s))); assert(e.shape == s.shape); assert(e != s); alias S = DeepElementType!(typeof(s)); alias E = DeepElementType!(typeof(e)); static assert(is(S == E));
Construct new slice having the same element type and shape to given slice.