Custom iterators over custom types

Yes, of course. Thanks :slight_smile:

The fact that Vector{A{Int}} is not <: Vector{A} is what is meant by invariance, so that’s why I suggested that you probably need to read over that section again. (As explained in that section, Julia’s invariant semantics are critical for performance because it allows Vector{A{Int}} to be a “flat” array consecutive A{Int} objects in memory, rather than array of pointers to “boxes” that can hold an arbitrary A.)

3 Likes