Why is getindex not implemented for Iterators.ProductIterator?

julia> function myrand(itr::BIP{NTuple{N, T}}, n::Int) where {N, T<:AbstractArray}
           elts = eltype.(itr.iterators)
           res = Vector{Tuple{elts...}}(undef, n)
           for i in eachindex(res)
               res[i] = Tuple(myrand(itr))
           end
           res
       end

julia> myrand(s,2)
2-element Vector{Tuple{Int64, Int64}}:
 (2, 19)
 (7, 14)

1 Like