A nice side-effect of using such a trait as a bound to the range argument type A is that the meaning of iter::range(a, b) would become coherent (same regardless of A) and more intuitive: returns a DoubleEndedIterator to all the possible (and valid) values of type A in [a, b) in ascending order.
> On 10 Apr 2014, at 09:27, Kevin Ballard <[email protected]> wrote: > > On Apr 9, 2014, at 11:25 PM, Tommi Tissari <[email protected]> wrote: > >>> On 10 Apr 2014, at 07:55, Corey Richardson <[email protected]> wrote: >>> >>> range doesn't return a forward iterator. Range<A> also implements >>> DoubleEndedIterator. >> >> Ok, I didn't realize that. But it still should't require Add<A, A> when all >> it needs is a way to get to the next and previous values. > > Any such trait for this would really need to be designed expressly for Range, > and then reimplemented for every single numeric type. > > -Kevin _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
