When defining a generic function, the type parameter syntax looks like this:
fn generic<T, ...>(...) ...
But when calling it, there’s an additional double-colon between the function name and the pointy brackets:
generic::<T, ...>(...)
Would anyone happen to know if there’s a particular reason for this? I must admit it had me confused for quite a while, the calls looked a bit like magic to me since you don’t see this syntax (::<...>
) elsewhere and I didn’t immediately make the connection with generic function definitions
To be entirely clear on what I’m trying to get at: if the syntax for the definition and the call had been the same, I think it would have been clear to me they’re one and the same thing from the get go. So I’m wondering if there’s a particular reason why they’re not