On Tuesday, 7 July 2020 at 20:05:37 UTC, Steven Schveighoffer wrote:
On 7/7/20 4:04 PM, Steven Schveighoffer wrote:

Have you tried (T: U[], U)(ref T[] s) ?

Ugh... (T: U[], U)(ref T s)

-Steve

Thank you, that worked and now it picked the correct overloaded function. I don't understand why and it is a bit counter intuitive. Why two template arguments as I'm not even us using U?

If you look at the article

https://dlang.org/articles/templates-revisited.html#specialization

Then it mentioned that (T : T*) would work. Intuitively, then you would think (T : T[]) would work.

Reply via email to