Bitstype homonyms?


I have a 64-bit bitstype that is bit-equivalent to Float64 and does math as Float64 does. I can reinterpret one to the other. I would like to do something reinterpret-like with vectors and matricies (maybe StaticArrays) formed thereof. The goal is to avoid copying (in both directions) by some-sort-of type punning. With the understanding that this is unsafe and would be an internal mechanism only, is there a way?


Do you mean something like:

julia> reinterpret(SVector{5, Float64}, rand(5,5), (5,1))
5×1 Array{StaticArrays.SVector{5,Float64},2}:



@kristoffer.carlsson Now I see it. Thank you.