4 ms·
Wouldn't the type guarantees provided by rusts type system allow for different implementations based on whether it was called on value types vs reference types?
by saosebastiao 10y ago
Wouldn't the type guarantees provided by rusts type system allow for different implementations based on whether it was called on value types vs reference types? I thought there was an auto specialization feature created a while ago that did something like that.
- foota 10y agoI think the into iterator version borrows the references (did I say that right?
- Tuna-Fish 10y agoIt allows changing implementation depending on what you pass it, but it cannot change how you pass things. The issue is that if you just call zip(code_lengths), then ownership of code_lengths is passed into the function and it ceases to work in it's parent.