Closed
Description
Usually similar
returns the same type, but for SArray
it does not. Is there no solution for getting "the same array" with a new element type?
if typeof(A) <: StaticArray
B = similar_type(A,T)
else
B = similar(A,T)
end
That's the only solution I could come up with, and it requires separate codepaths every time an SArray
is encounters and makes it tough to write generic codes. I am hoping there's a method I missed.
Metadata
Metadata
Assignees
Labels
No labels