3 ms·
It’s called out in the proposal, but generics allow custom container types to be created like ordered map. Iterators allow nice methods to be created by designe
by MarkMarine 2y ago
It’s called out in the proposal, but generics allow custom container types to be created like ordered map. Iterators allow nice methods to be created by designers of these containers types, and used in a way that is similar to the go collections like map and slice. Mentioned earlier in the comments, someone brought up in order tree traversal as well.
I don’t see an issue having the for range syntax that works magically for go std lib containers extended to custom containers, especially since go std lib omits so many valuable containers