# Custom iterators over custom types

**URL:** <https://discourse.julialang.org/t/custom-iterators-over-custom-types/1160>\
**Category:** General Usage\
**Created:** [December 27, 2016, 1:22pm UTC](https://discourse.julialang.org/t/custom-iterators-over-custom-types/1160 "2016-12-27T13:22:05Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [December 28, 2016, 11:55pm UTC](https://discourse.julialang.org/t/custom-iterators-over-custom-types/1160/21 "2016-12-28T23:55:32Z")

</div>

Yes, of course. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [December 29, 2016, 1:41am UTC](https://discourse.julialang.org/t/custom-iterators-over-custom-types/1160/22 "2016-12-29T01:41:26Z")

</div>

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`.)

[Previous page](https://discourse.julialang.org/t/custom-iterators-over-custom-types/1160.md?page=1)
