Struct field as view of another field

You define the type of b to be Vector so the view will be converted to a normal array.

julia> a = [1., 2., 3.];

julia> b = convert(Vector{Float64}, @view a[1:2]);

julia> b[1] = 10
10

julia> a[1]
1.0
2 Likes