3 ms·
`()` is now overloadable, so one could implement that operators for arrays/vectors/slices to get indexing via ().
by dbaupp 12y ago
`()` is now overloadable, so one could implement that operators for arrays/vectors/slices to get indexing via ().
- eddyb 12y agoNot `map[k] = v;`, which is deal breaker.
- dbaupp 12y agoOther languages don't offer indexing sugar at all, so even minimal sugar for retrieving elements might be nice. There are however, more significant road blocks, like how to handle returning references (basically, we would be left in a similar situation to the current Index trait, which has its uses, but isn't what most indexing should do).
- eddyb 12y agoRight, that too, no first-class lvalues in Rust.