fn vectorLength(comptime VectorType: type) comptime_int VectorType: type105
106
107
108
109
110
111fn vectorLength(comptime VectorType: type) comptime_int {
return switch (@typeInfo(VectorType)) {
.vector => |info| info.len,
.array => |info| info.len,
else => @compileError("Invalid type " ++ @typeName(VectorType)),
};
}