I am not sure the performance. But it is not as flexible as eltype(field) approach as the eltype is achieved in a recursive way. Thus if T
in your definition is another AbstractArray
, then the approach proposed above will only return this AbstractArray
type rather than its element type.