@@ -20,6 +20,7 @@ $(T2 sliced, Creates a slice on top of an iterator, a pointer, or an array's poi
2020$(T2 slicedField, Creates a slice on top of a field, a random access range, or an array.)
2121$(T2 slicedNdField, Creates a slice on top of an ndField.)
2222$(T2 kindOf, Extracts $(LREF SliceKind).)
23+ $(T2 packsOf, Extracts dimension packs from a $(LREF Slice). Alias for $(LREF isSlice).)
2324$(T2 isSlice, Extracts dimension packs from a type. Extracts `null` if the template argument is not a `Slice`.)
2425$(T2 DeepElementType, Extracts the element type of a $(LREF Slice).)
2526$(T2 Structure, A tuple of lengths and strides.)
@@ -149,6 +150,17 @@ unittest
149150 static assert (kindOf! (Slice! (Universal, [1 ], int * )) == Universal);
150151}
151152
153+ // / Extracts dimension packs from a $(LREF Slice). Alias for $(LREF isSlice).
154+ alias packsOf (T) = isSlice! (T);
155+
156+ @safe pure nothrow @nogc
157+ unittest
158+ {
159+ alias S = Slice! (Universal, [2 , 3 ], int * );
160+
161+ static assert (packsOf! S == [2 , 3 ]);
162+ }
163+
152164private template SkipDimension (size_t dimension, size_t index)
153165{
154166 static if (index < dimension)
0 commit comments