Julia’s multidimensional.jl defines the methods
ndims(::Type{CartesianIndices{N}}) where {N} = N
ndims(::Type{CartesianIndices{N,TT}}) where {N,TT} = N
I wonder if these may not be written concisely as
ndims(::Type{<:CartesianIndices{N}}) where {N} = N
?
is there a reason for the explicit specialization in the methods above? Is there a performance gain expected from this? Is this a pattern that users might consider using for their own code?