Are temporaries created in one line functions that return the result of a broadcasted function?

Yes, a temporary will likely be created. The proper way to use broadcasting in this way is

tst .= signed_dist.(pc,Ref(F))

so that the two broadcast operations will fuse and avoid creating the temporary array.

3 Likes