3 ms·
I was very much under the impression that Rust used monomorphization, and that there was no concept of generics at runtime (unlike, say the CLR). Am I missing s
by jen20 6y ago
I was very much under the impression that Rust used monomorphization, and that there was no concept of generics at runtime (unlike, say the CLR). Am I missing something here?
- zozbot234 6y agoRust supports both monomorphized and type-erased implementations, the latter via the `dyn` keyword when instantiating a trait (similar to an interface in Java).
- jacoblambda 6y agoThey support both but general rule of thumb I've found from the community is use the prior by default unless you have to use the latter.