stride - return the number of elements between each dimension of an array
arr.stride()
Returns a PackInt
vector containing, for each
dimension of the array, the size of the sub-array to the
"right" of that dimension. This is useful in conjunction
with the flattened array indexing operators #[ ]
and #[ = ]
.
A PackInt
vector containing the size of each
sub-array
TypeCheck
if arr is not an array.
a = [2,3,4].iterate() a.stride() 12 4 1 a[0].sizeof() 12 a[0,0].sizeof() 4 a[0,0,0].sizeof() 1