3 ms·
It matters for two reasons I can see: * Is this function monomorphised for each type passed in or is the argument passed in as a trait object? If the latter, d
by Measter 4y ago
It matters for two reasons I can see:
* Is this function monomorphised for each type passed in or is the argument passed in as a trait object? If the latter, does it implicitly fall back to monomorpisation if the trait is not Object-safe(e.g. it takes or return `Self` by ownership)? How do we specify which of the two to use when we need to for performance reasons?
* Let's say we have a function with two inputs: `func foo(a: SomeTrait, b: SomeTrait)` How do I specify that both inputs must be the same type?