# Broadcasting over a struct with two arrays

**URL:** <https://discourse.julialang.org/t/broadcasting-over-a-struct-with-two-arrays/26136>\
**Category:** General Usage\
**Tags:** broadcast\
**Created:** [July 8, 2019, 12:50pm UTC](https://discourse.julialang.org/t/broadcasting-over-a-struct-with-two-arrays/26136 "2019-07-08T12:50:09Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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:** [July 8, 2019, 3:39pm UTC](https://discourse.julialang.org/t/broadcasting-over-a-struct-with-two-arrays/26136/6 "2019-07-08T15:39:06Z")

</div>

Check out

> [@Customizing Broadcasting Recursively for Collections of Arrays](https://discourse.julialang.org/t/customizing-broadcasting-recursively-for-collections-of-arrays/25724):
>
> I previously asked [this question](https://discourse.julialang.org/t/generalizing-dot-syntax-to-broadcast-operators-for-arbitrary-types/25459/4) and am aware of the section in the manual about customizing broadcasting. However, rather than defining a new type which behaves like a single array, I would like to define broadcasting recursively for types which contain several arrays (or types which are themselves collections of arrays). That is, imagine we have struct A{T so that broadcasting is already defined for T} a::T b::T end If x::A, y::A, calculate z = x .+ y by calling z.a = x.a .+ y.a (etc.). …

---

_[View the full topic](https://discourse.julialang.org/t/broadcasting-over-a-struct-with-two-arrays/26136)._
