3 ms·
The problem is that it operates on an abstract interface but it is NOT generic. With any Generics implementation that generates code for the specific type under
by JulienSchmidt 10y ago
The problem is that it operates on an abstract interface but it is NOT generic.
With any Generics implementation that generates code for the specific type under the hood (e.g. at compile-time like C++ Templates or Rust Traits, or just-in-time), there would be no overhead.
- mjburgess 10y agoYeah, this is what you get when your language does not support generics.
- amelius 10y agoTrue. But a compiler can also perform inference, and optimize this without type information. Of course, it becomes less reliable, because you'd have to trust that the compiler does this (and consistently over changes to the code).