mir_slice.length

Multidimensional length property.

struct mir_slice(Iterator_, size_t N_ = 1, SliceKind kind_ = Contiguous, Labels_...)
@safe @property scope const
@optmath
size_t
length
(
size_t dimension = 0
)
()
if (
dimension < N
)
if (
0 < N_ &&
N_ < 255
&&
!(
kind_ == Canonical &&
N_ == 1
)
&&
Labels_.length <= N_
&&
isIterator!Iterator_
)

Return Value

Type: size_t

length of the corresponding dimension

Examples

import mir.ndslice.topology : iota;
auto slice = iota(3, 4, 5);
assert(slice.length   == 3);
assert(slice.length!0 == 3);
assert(slice.length!1 == 4);
assert(slice.length!2 == 5);

See Also

Meta