# Support CartesianIndices with Arrays and other iterables, not just ranges (alternative?)

**URL:** <https://discourse.julialang.org/t/support-cartesianindices-with-arrays-and-other-iterables-not-just-ranges-alternative/22812>\
**Category:** General Usage\
**Tags:** performance, indexing\
**Created:** [April 5, 2019, 5:54pm UTC](https://discourse.julialang.org/t/support-cartesianindices-with-arrays-and-other-iterables-not-just-ranges-alternative/22812 "2019-04-05T17:54:04Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)\
**Post date:** [April 8, 2019, 2:41pm UTC](https://discourse.julialang.org/t/support-cartesianindices-with-arrays-and-other-iterables-not-just-ranges-alternative/22812/8 "2019-04-08T14:41:04Z")

</div>

They’re just highly specialized structures, designed to represent all the indexable locations in an array or a contiguous rectangular subsection. That’s their purpose, and the advantage of this limitation is that they have a slew of optimizations that are only valid for unit ranges.

---

_[View the full topic](https://discourse.julialang.org/t/support-cartesianindices-with-arrays-and-other-iterables-not-just-ranges-alternative/22812)._
