I am trying to customizing broadcasting my own type. However, I found the Julia doc section is little bit hard to follow. Can here someone tell me what is the use of the ElType
argument in
Base.similar(bc::Broadcasted{DestStyle}, ::Type{ElType})
In particular, for the following example, I cannot understand this line
ArrayAndChar(similar(Array{ElType}, axes(bc)), A.char)
Why not implement a similar
method for ArrayAndChar
such as
Base.similar(a::ArrayAndChar)
return ArrayAndChar(a.data, a.char)
end
Then the above line can be simply written as
similar(A)
What am I missing?