# StaticArrays as vector elements

**URL:** https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472
**Category:** General Usage
**Created:** [March 25, 2020, 12:26am UTC](https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472 "2020-03-25T00:26:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [March 25, 2020, 12:26am UTC](https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472/1 "2020-03-25T00:26:46Z")

</div>

I remember having seen somewhere an argument that stated that static vectors were stored sequentially (contiguously) in an array of such vectors. No pointers were stored, the data itself. Would anyone remember where to find this?

---

<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: [March 25, 2020, 12:56am UTC](https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472/2 "2020-03-25T00:56:42Z")

</div>

Immutable `isbits` struct and tuple data are always stored inline in arrays.

---

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [March 25, 2020, 12:57am UTC](https://discourse.julialang.org/t/staticarrays-as-vector-elements/36472/3 "2020-03-25T00:57:13Z")

</div>

While I don’t have a source for you, this is true of any `struct` that stores data for which `isbits(data) == true`, not just static arrays, and if you construct a static array where the eltype is not `isbits`, i.e. an abstract eltype, then it won’t be stored inline.

As of julia 1.4, struct with fields that are a union of `isbits` types will also be stored inline. The source this can be seen here: [julia/NEWS.md at v1.4.0 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/blob/v1.4.0/NEWS.md#new-language-features)
