This reply is on a new thread but since you mentioned the solution with duck-typing, of which I was aware, I have a related question. Assuming I know that this function will be applied to only types T1 or T2, is it better to use the second solution with Union in terms of performance? I would assume so but am no expert in this field...
- [julia-users] Define a function for two unrelated type... amiksvi
- Re: [julia-users] Define a function for two unrel... Stefan Karpinski
- Re: [julia-users] Define a function for two u... amiksvi
- Re: [julia-users] Define a function for t... amiksvi
- Re: [julia-users] Define a function for t... Milan Bouchet-Valat