# Custom StaticArray type

**URL:** https://discourse.julialang.org/t/custom-staticarray-type/33193
**Category:** New to Julia
**Created:** [January 10, 2020, 2:10pm UTC](https://discourse.julialang.org/t/custom-staticarray-type/33193 "2020-01-10T14:10:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [January 10, 2020, 2:10pm UTC](https://discourse.julialang.org/t/custom-staticarray-type/33193/1 "2020-01-10T14:10:50Z")

</div>

from [StaticArrays doc](https://juliaarrays.github.io/StaticArrays.jl/stable/pages/api/#Implementing-your-own-types-1), we can “easily” create our own `StaticArray` type… unfortunately no example is provided on the doc…

could someone be nice enough to post an example (of immutable type is good enough)? many thanks.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [January 10, 2020, 2:27pm UTC](https://discourse.julialang.org/t/custom-staticarray-type/33193/2 "2020-01-10T14:27:40Z")

</div>

As the docs mention, you can look at [`MArray`](https://github.com/JuliaArrays/StaticArrays.jl/blob/98db703d0ed74b0f062f350f7de7fdcd845f4989/src/MArray.jl) — ignoring the macro, it is pretty simple.

---

<div class="post-metadata">

### Author: ![mateuszbaran](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mateuszbaran/32/221842_2.png) [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)
#### Post date: [January 10, 2020, 8:32pm UTC](https://discourse.julialang.org/t/custom-staticarray-type/33193/3 "2020-01-10T20:32:31Z")

</div>

I think it’s also good to look at [SizedArray](https://github.com/JuliaArrays/StaticArrays.jl/blob/98db703d0ed74b0f062f350f7de7fdcd845f4989/src/SizedArray.jl). I’ve made two `StaticArray` types by copying and modifying that linked file.
