On Thu, May 30, 2013 at 4:49 PM, Mitch Skinner <[email protected]> wrote: > I'm not sure how much this overlaps with what you're proposing, but > regarding hashmaps: > > I'm hoping to see overloadable IndexAddAssign and IndexMulAssign and friends > someday, and the notion of neutral element differs between them, e.g.: > > > impl<K,V:Zero> HashMap<K,V> { > ... IndexAddAssign ... > } > impl<K,V:One> HashMap<K,V> { > ... IndexMulAssign ... > } > > So I guess the question I'm asking is, is Zero universal enough to make it a > library convention? > > Mitch
I don't think Zero/One are needed for Index methods, since it's already defined as failing if the element isn't present for vectors. It would be odd to implement it differently for other types. _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
